Hi,
I’ve asked several questions in different threads in this forums and I got many answers and suggestions, that have helped to make what you can see in this examples:
- Only ship moves and rotates: http://www.kingsware.de/j3d/gameRot2.zip (use mouse for rotation, strg for Fwd-movement and the Arrowkeys for Sliding up/left/right/down)
- The ship rotates and moves and the view follows: http://www.kingsware.de/j3d/gamerot3.zip (use mouse for rotation, strg for Fwd-movement and the Arrowkeys for Sliding up/left/right/down)
In the first example you can see, that my ship rotates correctly around his local x- and y-axis and moves relatively to the rotation!!! So this problem is solved!!!
In the second example you can see that the View seems to follow the ship correctly, because the ship is everytime at the same point in the window and even the Perspective to the ship doesn’t change. But although I didn’t change the Movement & rotation code of my Ship (processShipTransform), both ship and view don’t rotate and move correctly!
Problems:
- There is a rotation around the z-axis when you try to rotate up and down. This problem exists only when you had rotated to the left or to the right (around the x-axis) first. So only at a “x-rotation != 0” the ship and view rotates around the z-axis to!
- Movement and rotation is stuttering, when using wakeupOnElapsedFrames and the movement and rotation depends on passed time between frames(e.g. MeterPerSecond/FramesPerSecond).
2.1 Movement/Rotation without using the timebased movement does NOT flicker(e.g. MeterPerSecond/CONSTANTFRAMERATE).
2.2 When using WakeupOnElapsedTime(40) this problem does not exist, but updaterate wouldn’t depend on machinespeed anymore! - The View follows the ship directly. I’d like to have smoothed camera movement. The View should accelerate a littlebit slower than the ship (rotation & movement)
In the next Entry I show you most of the code used in the 2. example! Only difference in the 1. example is that there is an empty Transform3D returned by “processViewTransform”!
It would be nice if anyone could help me with this small mistakes (perhaps reply a little codecorrection ;))!
Thanks to all of you (especially endolf)!
Don’t have a too deep look at my bad English, please! I’m not only learning Java3d at all ;)!
Greets,
Juan