Object3D rotation problem

Started by Uija, July 24, 2005, 05:40:57 PM

Previous topic - Next topic

Uija

I have a Object3D.
When I move it forwards it moves to the north.
Now I rotateY() it, so it looks to the East.
When I now move it forwards it still moves to the north.
I found 2 threads about this, both seem to got it work with the mentioned methods but it didn't work for me.

Uija

I got the thing running with moving by getZAxis().
But now I am strafing all the time ;)
Rotating the Model doesn't help, als it rotates the movement axis too.

EgonOlsen

Quote from: "Uija"But now I am strafing all the time ;)
Rotating the Model doesn't help, als it rotates the movement axis too.
I don't quite understand...movement can either be relative to the object's orientation (as you are doing it by using getZAxis() for example) or absolute (for example by 0,0,1 to move 'inside' the screen). What's the actual problem with strafing now?

Uija

I load the Model and move with the getZAxis()...
THIS is how it looks like. (Cam direction is the one, the dragon is moving)
So every step it does, it is strafing... I used every model I found... all did the same.
I hope you understand better now ;)

EgonOlsen

Quote from: "Uija"THIS is how it looks like.
i think you linked to the wrong picture. Is this the correct one: http://uija.net/images/error_rotation.jpg?
QuoteI hope you understand better now ;)
Well...uhmm...no... :?:

If you move the dragon into its local z axis' direction, it should move to the right (given the picture is the correct one). If you move it into the direction of the global z axis, it should move into the screen. I still don't get what you expect it to do instead... :?:

Uija

yeah, i posted the wrong picture =)

The problem is, that the dragon is NOT running to the direction "he" is looking to.
I move him with

SimpleVector s = player.getZAxis();
s.scalarMul( RUN_SPEED);
player.translate( s);


I inserted a arrow here that show the direction the dragon is moving with the code above and I am still searching for the code, how I can rotate without touching the Moveaxis

EgonOlsen

Maybe that is his z axis then? What happens if you translate it along the getXAxis()?

Uija

OMG, I should go to bed. haha, yeah, I had my thoughts everywhere but not there *sigh*
Thanks a ton for your help and of cause jPCT!