Would you care to publish your code here? The implementation of
the com.sun.j3d Intersect class does not handle exact intersection of
rays with edges of the triangle, and secondly, the class has been
deprecated in version 1.2 as it is no longer needed. This might be
the case for the behaviours, just too bad I used it for some other
calculations. So, I'd definitely be interested in getting this piece of
code instead of doing my own implementation.

Best regards,

Christoph


>>> [EMAIL PROTECTED] 05/29/00 01:30PM >>>
I had a similar problem, and used the same method you have below. The algorithm
is correct if you assume the intersect distance is placed in dist[0], however
this may not be the case. The documentation on Intersect doesn't define what
dist[0] does(why is it an array?), or what value is placed back in it if an
intersect returns true. The value of dist[0] is changed, but I have not been
able to make sense out of the values placed in it.

In my case I had to write my own ray-triangle intersector to get results I
could trust.

Yu Kui Zhou wrote:

> Given Intersect.rayAndTriangle(myRay, coords, 3, dist)) = true,
> I wnat to find the point of intersection - interPoint. I tried
> the following code to do the job
>
> //dist[0]-the distance between the origin of the
> //myRay and the point of intersection.
>
>     Point3d interPoint = new Point3d();
>     Vector3d di = new Vector3d();
>     myRay.get(interPoint, di);//(origin,direction vector)
>     di.normalize();//normalising the direction vector
>     di.scale(dist[0]); //di = dist[0]*di
>     interPoint.add(di);//interPoint=di+interPoint
>
> The result derived however was wrong. I really have no idea why
> is that. I appreciate if you can help.
>
> Zhou
>
> Email:  [EMAIL PROTECTED]
> fax +61-2-6249 0506
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff JAVA3D-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to