Game Development Community

Image Rotation

by Eric Hartman · in Torque Game Engine · 08/15/2002 (9:30 pm) · 3 replies

How do i set the rotation property of an image data block?

say i have something like this:

datablock ShapeBaseImageData(gunImage)
{
shapeFile = "gun.dts";
mountPoint = 1;
offset = "1.0 0.5 2.0"
rotation = "? ? ? ?"
...

How do i figure out what to put in for those question marks? I dont understand how its supposed to work since it requires 4 numbers and when i guess it comes out all streched out and wierd.

#1
08/15/2002 (10:12 pm)
Rotation is set up like:

rotation = "x y z degree";

If you wanted to rotate it 90 deg. on the y axis then it would be like this

rotation = "0 1 0 90";
#2
08/15/2002 (10:23 pm)
But how do i rotate it about more than one axis? Its possible since the mission editor stores rotation this way, but i dont know how to.
#3
08/16/2002 (12:19 pm)
I tried using the last 4 numbers returned by matrixcreatefromeuler("x y z"); but the angle appears to be wrong (yes i converted from radians to degrees);