Picking

New Message Reply Date view Thread view Subject view Author view

Marco Crocetta (onyx++at++datamat.it)
Wed, 12 Apr 95 10:34:50 METDST


Hi,

I'm starting to work with the Picking feature of Performer.
I went through the pickfly example but it does a lot of things
that I don't really need (and maybe it's not easy to understand)
so I tried to start creating a simple Pick function that is called
by my intersection callback:

void Pick(void)
{

struct
{
     pfScene *scene;
     pfChannel **chan;
     pfNode *picked;
     pfPath *path;
     char *pathname;
     float pickX;
     float pickY;
     long traverse;
} Pick;

    long pick_count = 0;
    static pfHit **ipicked[10];
    float px,py;

   pfNodePickSetup(Shared->scene);
   pfuCalcNormalizedChanXY(&px,&py,Shared->masterChan,
                   Shared->mouse.clickDownX,Shared->mouse.clickDownY);

    pick_count = pfChanPick(Shared->masterChan,PFPK_M_NEAREST,px,py, 1.0f, ipicked);

    if (pick_count > 0)
    {
        pfQueryHit(*ipicked[0], PFQHIT_NODE, &Pick.picked);
        pfQueryHit(*ipicked[0], PFQHIT_PATH, &Pick.path);
        pfNotify(PFNFY_INFO, PFNFY_PRINT,"INTERSECTION FOUND");
    }
    else
        Pick.picked = NULL;

}

The problem is that nothing seems to be picked...
Do I have to do other things to make the picking works (all the stuff
in the pickfly example)?

Thanks in Advance.

P.S. Thanks for the help about my previous problem.

--------------------------
Marco Crocetta
DATAMAT SpA, Rome
e-mail:onyx++at++datamat.it
--------------------------


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:17 PDT

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