pfChanPick

New Message Reply Date view Thread view Subject view Author view

Suguru Ishizaki (suguru++at++media.mit.edu)
Thu, 28 Jul 94 18:29:17 -0400


I have recently switched to Performer 1.2 and found the picking
function is not quite the same as that of 1.1. The following is the
simplified source code re-written for 1.2 and it doesn't work.
"pfChanPick" returns 0 most of the time; but it sometimes returns
non-zero when I do not hit any object. I am certain that the other
part of the code is correct since this program worked perfectly when I
was using 1.1.

----------------- source code -----------------
      .
      .
      .

      pfHit **hit[10];

      long hit_flags;
      pfGeoSet *hit_gset;
      pfNode *hit_geode;
      pfVec3 hit_point;
      long pick_count;

      pfNodePickSetup(Scene);

      .
      .
      .

      pickx = (float) getvaluator(MOUSEX);
      picky = (float) getvaluator(MOUSEY);
      getsize(&win_wd, &win_ht);
      getorigin(&win_x, &win_y);
      pickx = (pickx - (float) win_x) / win_wd;
      picky = (picky - (float) win_y) / win_ht;

      pick_count = pfChanPick(chan0, PFTRAV_IS_GSET, pickx, picky, 0.0f, hit);

      pfQueryHit(*hit[0], PFQHIT_GSET, hit_gset);
      pfQueryHit(*hit[0], PFQHIT_FLAGS, &hit_flags);
      pfQueryHit(*hit[0], PFQHIT_POINT, hit_point);

      .
      .
      .

----------------- end of source code -----------------

I'm sure I'm dowing something wrong.
I would appreciate if anybody can point me what's wrong.

Thank you.

Suguru Ishizaki
Visible Language Workshop
Media Laboratory, MIT


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:50:25 PDT

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