Hallo everybody,
The next Newbee who wants to develop a spaceship game:)
At first, sorry for my bad English. I try to do my best.
Let me explain my problems:
I (want to) make a 3dgame, in that you fly with a spaceship trough an endless space with endless asteroids.
All the time the spaceship move forward , but you can change the direction point up/down and left/right.
That mean, theoretical you can fly eg. head-over in the "Matrix" and if you want to move the direction point up at the player view, in the matrix the direction down must move down.
This demo is a very good example to discripe the Movementfunction(the demo only support Camera rotating, but it shows what i need):
http://www.jpct.net/jpct-ae/download/alpha/Demo.java (if somebody knows this Demo, i get this link from google, i cant find a way to it on the homepage...)
Some Facts:
I have an ship class with following (important) variables/classes:
Object3d mesh
SimpleVector position (eg 0,0,0)
SimpleVector direction (eg 0,0,1)
float AxisXchange (eg 0°)
float AxisYchange (eg 5°, this value comes from the Movement functions, because the player wants to move the direction point up)
And i think i need an Vector/variable, which shows the ..ARGHH i cant explain... but seems I need to;)
Imaging the ship is at the position vector and "looks" at the direction vector.
We need an another information which show which "roll" status the ship has.
But this we need at the second step i think.
ok, enough enough...
First i want to understand on what way i can rotate the direction point around the position point.
This code isn't correct:
SimpleVector currentXAxis = mesh.getXAxis();
SimpleVector currentYAxis = mesh.getYAxis();
direction.rotateAxis(currentXAxis,AxisXchange);
direction.rotateAxis(currentYAxis,AxisYchange);
this.positiontranslate.x = delta * direction.x * speeddirection;
this.positiontranslate.y = delta * direction.y * speeddirection;
this.positiontranslate.z = delta * direction.z * speeddirection;
this.mesh.translate(this.positiontranslate);
I think I need to create a translation matrix with the position and direction Vector, but i am not the best in math-things like this.,
I would be very glad if someone could help me a bit with that. If you (yes you! are very probably the person who can help me
) need more information, please tell me.
With best regards
Jan