Author Topic: Object3D rotation problem  (Read 4070 times)

Offline Uija

  • int
  • **
  • Posts: 52
    • View Profile
Object3D rotation problem
« 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.

Offline Uija

  • int
  • **
  • Posts: 52
    • View Profile
Object3D rotation problem
« Reply #1 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Object3D rotation problem
« Reply #2 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?

Offline Uija

  • int
  • **
  • Posts: 52
    • View Profile
Object3D rotation problem
« Reply #3 on: July 24, 2005, 07:22:48 pm »
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 ;)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Object3D rotation problem
« Reply #4 on: July 24, 2005, 07:35:59 pm »
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?
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... :?:

Offline Uija

  • int
  • **
  • Posts: 52
    • View Profile
Object3D rotation problem
« Reply #5 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 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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Object3D rotation problem
« Reply #6 on: July 24, 2005, 09:02:27 pm »
Maybe that is his z axis then? What happens if you translate it along the getXAxis()?

Offline Uija

  • int
  • **
  • Posts: 52
    • View Profile
Object3D rotation problem
« Reply #7 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!