Question about pfGetchild & switch

New Message Reply Date view Thread view Subject view Author view

Choon H Lee (aut++at++engin.umich.edu)
Thu, 20 Apr 1995 23:07:32 +0100


Could anyone give a hint what might be wrong with the following code?
The return value of the line

    cc = pfGetChild(ViewState->sceneGroup, 0);

turns to be 0, although it should not be.

long
initSceneGraph(pfScene *scene)
{
    pfGroup *root;
    long i;
    long loaded = 0;
    pfSphere bsphere;
    pfGroup *newbut;
    pfSwitch *s;
    pfNode *cc, *cc2;

    /* Create a DCS for TRACKBALL pfuXformer */
    ViewState->sceneDCS = pfNewDCS();
    ViewState->sceneGroup = pfNewGroup();
    pfAddChild(scene, ViewState->sceneDCS);
    pfAddChild(ViewState->sceneDCS, ViewState->sceneGroup);

        ...

    /* add switch for changing button color */

    cc = pfGetChild(ViewState->sceneGroup, 0);
    cc2 = pfGetChild(cc, 0);
    cc = pfGetChild(cc2, 6);

        ...

}

Thanks in advance,

-- Choon.

_________________________________________________________________________
 Choon H. LEE phone: (313) 769 7834 (home)
 College of Engineering
 The University of Michigan
 Ann Arbor, MI 48109, U.S.A. email: aut++at++engin.umich.edu
_________________________________________________________________________
        Art is to beauty what honor is to honesty.
                                        -- Winston Churchill


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:51:24 PDT

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