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