Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Raytracing a Java3D scene's View

843799Feb 22 2004 — edited Mar 17 2004
Hi,

I have a simple Java3D modelling app, which I am trying to hook up a basic Raytracer to.

Scene Graph looks something like the following:
                 VirtualUniverse, etc
                          |
                       Locale
                          |
                     /         \
    ContentBranchGroup         ViewsBranchGroup
            |                          |
           ...                 TransformGroup [*]
                                       |
                                 ViewPlatform  -  View
I have a simple mouse pan behaviour, a mouse zoom behaviour, and a mouse orbit behaviour that all modify the Transform Group marked with a [*] above, thereby changing the "camera" by which the user looks at the scene. The behaviours work very well.

I am trying to hook the raytracer up to "look" through this camera. (I have all the other raytracer stuff working)

The raytracer requires the following:
- The camera eye position
- The camera target (look at) position
- The camera up vector

I am trying to extract this information from the [*] marked TransformGroup's Transform3D object but it is very difficult. I can get the eye position using the transform3D.get(Vector3d) method.

I have tried so many ways to get the target and up vectors. I know the principles to get them but the Transform3D get() methods are to say the least, a nightmare, for me to work with. CAN ANYBODY HELP ME?

If it helps I have managed to get the Euler angles for the camera rotation (converting the rotation Quaternion)...

What next? Please...!

Thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 14 2004
Added on Feb 22 2004
11 comments
613 views