pfFlatten

New Message Reply Date view Thread view Subject view Author view

chris (chris++at++scotch.physics.ucla.edu)
Wed, 8 Jan 1997 12:47:16 -0800


Hi all.

Hope some helpful soul can point me in the right direction.
The scs->flatten(0) below causes a bus error. The weird thing
is that this code is functionally identical to perfly.C around
line 315. The only difference I can see is that the call to
scs->addChild() in perfly adds a pfGroup, whereas mine adds a
pfLOD. Does that matter? I'm using performer 2.1 on an
Indigo2 Max Impact.

My code:

        pfLOD* V = makeLODs(arena);
        pfMatrix scsMat;
        pfVec3 veci,vecf,trans;
        pfSCS* scs;
        veci.set(0.f,1.f,0.f);
        for(j=0,i=0;j<FLOATS/6;j++)
        {
                vecf.set(dirvec[i],dirvec[i+1],dirvec[i+2]);
                trans.set(transvec[i],transvec[i+1],transvec[i+2]);
                scsMat.makeIdent();
                scsMat.makeVecRotVec(veci,vecf);
                scsMat.setRow(3,trans);
                scs = new pfSCS(scsMat);
                scs->addChild(V);
                scs->flatten(FLATTEN_MODE);
                scs->removeChild(V);
                dcsmom->addChild(scs);
                pfDelete(scs);
                i+=3;
        }

Perfly code:

   297 if (ViewState->explode > 0.0f)
   298 {
   299 float x;
   300 float y;
   301 float z;
   302 pfMatrix matrix;
   303 pfSCS *scs;
   304
   305 x = ViewState->explode*((random() & 0xffff)/65535.0f - 0.5f);
   306 y = ViewState->explode*((random() & 0xffff)/65535.0f - 0.5f);
   307 z = ViewState->explode*((random() & 0xffff)/65535.0f - 0.5f);
   308
   309 /* move the object by placing it beneath an SCS node */
   310 matrix.makeTrans(x, y, z);
   311 scs = new pfSCS(matrix);
   312 scs->addChild(root);
   313
   314 /* go ahead and apply the SCS matrix to the geometry */
   315 scs->flatten(0);
   316
   317 /* detach (transformed) object from SCS; discard SCS */
   318 scs->removeChild(root);
   319 pfDelete(scs);
   320 }

Thanks for any help. I really appreciate it.

Chris

Chris Mitchell
UCLA Physics Department
LAPD Plasma Lab
310-206-1772
chrism++at++ucla.edu
http://scotch.physics.ucla.edu/~chris
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:18 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.