model direction problem

Hello,

I have a lot of 3D models,and I have really wierd problem with my ship model direction.
My direction code is allways the same:

elapsed = self.elapsed
self.backward = self.brod.getNetTransform().getMat().getRow3(1)
self.backward.setZ(0)
self.backward.normalize()
i=self.backward*(elapsed*45*0.4)
self.brod.setPos(self.brod.getPos()+i)     
self.c_node.setPos(self.c_node.getPos() +i)

…My fist ship model goes normal, but any ship model else goes diagonally.
I tried to put: self.brod.getPos()-i and self.c_node.getPos() -i , but nothing.

Sorry for my bad english!
Regards,
Veki

Your model is turned differently in the editor. You can redit them in the editor of fix them at starup.

Also your movement code is a bit different we are used to:

ship.setR(23)   # turn ship 23 degrees
ship.setPos(ship,Vec3(0,1,0)) #move ships 1 unit forward

i am really shot sure why you need getMat and stuff seams like you might be making life harder for yourself.

Hello,

I don’t know how to turn model differently.

ship.setR(23)   # turn ship 23 degrees
ship.setPos(ship,Vec3(0,1,0)) #move ships 1 unit forward 

This code is very useful.Thanks!

I had a few problems with this direction changing and actor moving,so I use this code and it was good.

Sorry for my bad english!
Regards,
Veki