Tina Manoharan Valappil wrote:
>
> Hi all,
Hi Tina,
>
> I want to know if it is possible to measure the distance
> between 2 random 3D points in the scene (not distance
> on the screen, but in the scene) ? I want to be able
> to click on a point in the scene, save its point as
> point-1 , similarly click on another point in the scene
> with a mouse and get point-2.
> Then I should be able to
> calculate the distance between the points. I know
> how I can get the exact screen co-ordinates by clicking on
> the screen. But, how can I convert those co-ordinates to
> that of the Scene ?
>
> Please help if u have an idea.
>
> Thanks
> Tina
> Tina Manohar
> PhD. Heriot Watt University
> Edinburgh
In my opinion you have to click at objects in the scene, because you
can't obtain a 3D Point in the scene only from the mouse-coordinates
(2D)
on the Canvas3D, since the "depth"-coordinate is missing. From the
intersection
of the pickray with an object you can get the missing 3rd coordinate.
Take ak look at the picking examples how to get these intersection
points.
Once you got them you can compute the distance e.g. with:
firstPoint.distance(secondPoint) ( e.g. Point3f from java.vecmath)
Happy hacking
Joerg
--
http://w5.cs.uni-sb.de/~baus
Email : [EMAIL PROTECTED]
Phone : +49-681-302-2016
Fax : +49-681-302-4136
===========================================================================
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".