If I am understanding your message correctly
you have a star map, which each star is a sphere with it's own transform?

and you want to be able to zoom in on a particular star when you click on it?

one note
are you moving the view platform? or are you moving the camera via moving all
other stars?
if you have a really big scene and you want to move around in it, move the view
platform instead
the following examples will only work if you are moving the view platform


one way to do this is to add user data to each star
inside this user data you could have a hashmap id value that you then look up
and get a reference to it's transform group
then, you can move your camera to a small distance away from that star
like this

TransformGroup starTG
TransformGroup cameraTG

get Transform3D from starTG
set cameraTG with this transform
create new transform3D with translation along Z set back a little
multiply cameraTG with this new stepped back transform
and whamo you are now sitting back a little from the star

so, what if you want to transform along with the star?

you could extend the RotationInterpolator class that does the rotation of the
star, but it can also have a method like
addTransformExtension(TransformGroup cameraTG, Vector3D
distance_to_put_transform_back)

this way, when your rotation behavior wakes up, you do the super event
then you also apply that transform to your cameraTG and then put it back in the
z direction a bit
that way, each time the star moves, you camera moves as well.


Scott
Scott Decker
Research Scientist
Pacific Northwest National Labs
[EMAIL PROTECTED]

=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/

Reply via email to