Rotations about its own axis

New Message Reply Date view Thread view Subject view Author view

LIM MING WAH (eng30228++at++leonis.nus.sg)
Mon, 6 Jan 1997 16:37:22 +0800 (SST)


Hi all,
        Thanks to many who have helped in one way or another!!!
         
        I have managed to load in few DCSs and switching them around, I
have also saved their matrices and tried to assign them back whenever I
switch them back so that perfly remembers their last position. But this
has not been so. Whenever I switch them back by assigning the
ViewState->sceneDCS = pointer; and then follow by the function
initXformer(), the objects will always reset to its original position.
The following is the content in initXformer():

void initXformer(void) {

    ViewState->xformer = pfiNewTDFXformer(pfGetSharedArena());
    pfiXformerAutoInput(ViewState->xformer, ViewState->masterChan,
        &ViewState->mouse, &ViewState->events);

    pfiXformerNode(ViewState->xformer, ViewState->sceneGroup);
    pfiXformerAutoPosition(ViewState->xformer, NULL, ViewState->sceneDCS);
    pfiXformerResetCoord(ViewState->xformer, &ViewState->initView);
    xformerModel(ViewState->xformerModel, ViewState->collideMode);
    resetPosition(POS_ORIG);

}

This is what I have added to perfly;

int oldchoice = -1;
pfMatrix storematrix[20];

void updatepos(int choice)
{

extern int NumFiles;
int current, g;

if (oldchoice == -1) /* Initialising the matrices with the DCSs */
{
        for (g=0; g<NumFiles; g++)
        {
                ViewState->sceneDCS = pointer[g];
                pfGetDCSMat(ViewState->sceneDCS, storematrix[g]);
        }
        oldchoice = 0;
        current = NumFiles - 1;
}

        pfGetDCSMat(ViewState->sceneDCS, storematrix[current]);
        ViewState->sceneDCS = pointer[choice];
        pfDCSMat(ViewState->sceneDCS, storematrix[choice]);
        current = choice;

}

I have also added to keybd.c ;

void toggleobject(int choice)
{

    updatepos(choice);
    initXformer();
}

Can anyone tell me what's wrong?

=======================================================================
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:16 PDT

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