www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: Uija on July 24, 2005, 05:40:57 pm

Title: Object3D rotation problem
Post by: Uija on July 24, 2005, 05:40:57 pm
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.
Title: Object3D rotation problem
Post by: Uija on July 24, 2005, 06:25:29 pm
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.
Title: Object3D rotation problem
Post by: EgonOlsen on July 24, 2005, 07:04:19 pm
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?
Title: Object3D rotation problem
Post by: Uija on July 24, 2005, 07:22:48 pm
I load the Model and move with the getZAxis()...
THIS (http://uija.net/images/text_error_screen.png) 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 ;)
Title: Object3D rotation problem
Post by: EgonOlsen on July 24, 2005, 07:35:59 pm
Quote from: "Uija"
THIS (http://uija.net/images/text_error_screen.png) 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?
Quote
I 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... :?:
Title: Object3D rotation problem
Post by: Uija on July 24, 2005, 08:27:23 pm
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
Code: [Select]

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


I inserted a arrow here (http://uija.net/images/error_rotation2.jpg) 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
Title: Object3D rotation problem
Post by: EgonOlsen on July 24, 2005, 09:02:27 pm
Maybe that is his z axis then? What happens if you translate it along the getXAxis()?
Title: Object3D rotation problem
Post by: Uija on July 24, 2005, 09:10:10 pm
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!