Game Development Community

Object rotation

by Justin Mosiman · in Torque Game Engine · 12/25/2006 (7:12 pm) · 2 replies

Hello,

I'm trying to rotate an object along the z axis, but I'm not having any luck. From the threads that I looked at, I would think that the following would work if I wanted to set the z rotation to 3.14:

MatrixF zRot;
zRot.set(EulerF(0,0,3.14));
mNewBuilding->setTransform(zRot);

But when I try to rotate it in game, the object just disappears.

Any ideas?

Thanks,
Justin

#1
12/25/2006 (11:29 pm)
MatrixF holds position as well. You are setting position to (0,0,0) with the above code. zRot.setColumn(3, Point3F()) would set your position. Are you checking this? Wish i had more ideas, but im not great in C++. Good luck, and happy holidays!
#2
12/25/2006 (11:52 pm)
Thank you, that was the problem. I didn't think that the MatrixF contained the position, but sure enough, when I went to point (0,0,0), there was the rotated object.

Happy holidays!