O.k. now i get it.

i kind of knew that you could mean a problem i had some time ago.

I see two possibilities that depend on the degree of freedom for looking at your scene.

1) What about having a not visible but intersectable geometry around your viewing 
position.
Simply intersect (using the picking utilities com.sun.j3d.util (?)) this geometry and 
you get a
coordinate for
putting your 3D mouse cursor. You are not limited to looking at a certain plane (being 
only able
to pan
around in the scene). Also the mouse cursor always appears at a certain size. The 
geometry to
choose could
be a simple sphere or a quad for emulating a finit plane. This will take some time to 
implement,
since you
might not have used the picking utilities yet.

2) if just panning is enough or you don't want to move the view at all, compute an 
intersection
with the plane your objects
lie in (e.g. the xy plane where z = 0). This intersection automatically determines the 
new
position for your mouse
geometry (that is located in the plane as well). Also not too easy to implement. It's 
easier to
use the 1st solution with a
invisible quad in the xy plane.

I was never able to use the image plate coordinates and transform them appropriately 
back to scene
coordinates.
There are to many things involved like the current size of the canvas3d the view 
policy the
transformation of the
avatar (physical body settings) and so on. Also, i couldn't find a method from sun to 
do this
coordinate to ray
transformation for me. So I always try to stay in the scene.

Cheers,
Karsten

PS: i'm not quite sure, but you should not implement mouse handling like you did in 
the example.
You should use
an appropriate behavior class (javax.media.j3d.Behavior). Be aware that all changes in 
the scene
graph (like
modifying the transform of the mouse geoemtry) should be executed by the java3d 
scheduler thread.
Otherwise
you'll get problems later with updating and so on.


"� - - �n +���ng� - - �" wrote:

> sorry abt that. what i was aiming to do is to create a shape,
> say a sphere on the space where the mouse was clicked. the
> z-coor will be fixed so the only problem is to get the
> corresponding x,y coor of the point on the vworld where i
> clicked the mouse. the Example3.java shows me where the points
> of the vworld are on a specific area of the canvas.
> this point is represented by the moving colorcube when you
> move your mouse within the window. the fix colorcube is just
> a marker to the center. as you would see, that was not what i
> wanted.
>
> my first solution is to move the z-coor close enough to the screen
> so that it would seem that the point where the mouse is matches
> with the coordinates on the vworld. but this solution doesnt
> increase the range of the x,y coor (�0.37, �0.37). i could scale
> it but it might not be a good solution all together.
>
> so, any ideas?
>
> thanks again in advance.
>
> - ian
>
> __________________________________
> www.edsamail.com
>
>   ------------------------------------------------------------------------
>                     Name: Example3.java
>    Example3.java    Type: Java Source 
>(application/x-unknown-content-type-JBuilder.JavaSource)
>                 Encoding: base64

===========================================================================
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