Text archives Help
- From: Abe Stephens <
>
- To:
- Cc:
- Subject: [Manta] Re: Cut Plane and Picking?
- Date: Mon, 7 Jul 2008 15:11:44 -0600
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type:mime-version:subject :date:references:x-mailer; b=mBhkh5z9uNDKRtRjSDAY4Aqff1Dvd1fBhhYitdPo6sSRzCMYBEpDDw6kzYoo03xuQT HvuLgoZn+kfQN+VSWVFJ90QNIC+cx+UtM4BtIseVyN6SbgtTPhSDTxXJGIRooUGRbNM/ nC20tqIkejtK21KXqcK69vBMTwKMbctJRumCE=
No- rather that the overloaded intersection would store the selectable group's ID in the ray packet scratch pad, and then the code that calls shootOneRay would know the format for the scratch pad and read the value from there.
Here's how I would probably do it these days:
- Add a new Group implementation for wrapping selectable objects. In the Intersect method check to see if intersection of the groups children modifies any of the hit info in the ray packet (perhaps by comparing before/after primitive ptrs). If so update the group id in the scratch pad depending on the hit primitive type, e.g. rays.getScratchpad<unsigned>(WaldTriangle::SCRATCH_LAST)[i].
- Place the new selectable group instance around each selectable object.
- Write a function called by a transaction to invoke shootOneRay, and then read the group ID out of the scratch pad.
Abe
On Jul 7, 2008, at 11:33 AM, Li-Ta Lo wrote: On Mon, 2008-07-07 at 11:18 -0600, Abe Stephens wrote: Yes, it is true. For the clipping plane see: MiscObjects/CuttingPlane.
{h,cc} This code was originally developed for the 777 demo and is
still used for some of the CSAFE visualization. It works with any
primitive.
Object selection was performed using lookup tables based on triangle
ID. The triangle ID was determined using the shootOneRay method in
MantaInterface and then examining the ray packet results. Primitive
intersection stored the triangle ID in the ray packet scratch space.
The acceleration structures and triangle intersections used today
don't support this functionality, but they could probably be extended
to do so easily.
Thanks a lot. Do you mean the RayPacket::getHitPrimitive() will return an acceleration structure rather than a real primitive like triangle? Ollie
|
Archive powered by MHonArc 2.6.16.