bobfritzelpuff
Solid State Member
- Messages
- 6
I am working in the Torque engine and running into some problems with the setting the transformation of objects. Here is my function that is giving me errors:
[the origonal transform is set to ("-90 -2 11 0 0 1 0")]
function Turn(%heart,%rx,%ry,%rz,%angle)
{
%var = %heart.getTransform();
%x = getword(%var,0);
%y = getword(%var,1);
%z = getword(%var,2);
%heart.setTransform(%x SPC %y SPC %z SPC %rx SPC %ry SPC %rz SPC %angle);
echo(%heart.getTransform());
//the above setTransform is the one I would like to use, the two below are
//just testing what happens when I try a differant approach
%heart.setTransform("-90 -2 11 0 0 1 20");
echo(%heart.getTransform());
%heart.setTransform("-90 -2 11 "@ %rx SPC %ry SPC %rz @" 30");
echo(%heart.getTransform());
}
The object's handle number is set to $t.
I run the function as Turn($t,0,0,0,30)
And the results of the echo's are:
-90 -2 11 1 0 0 0 (why is the x rotation one and the z rotation 0? And why isn't the final value 20?)
-90 -2 11 0 0 1 1.15 (why 1.15 and not 20?)
-90 -2 11 1 0 0 0 (again, x and z should be switched. Also, the final value should be 20)
I have no idea what in shiva's name is going on- can someone help?
[the origonal transform is set to ("-90 -2 11 0 0 1 0")]
function Turn(%heart,%rx,%ry,%rz,%angle)
{
%var = %heart.getTransform();
%x = getword(%var,0);
%y = getword(%var,1);
%z = getword(%var,2);
%heart.setTransform(%x SPC %y SPC %z SPC %rx SPC %ry SPC %rz SPC %angle);
echo(%heart.getTransform());
//the above setTransform is the one I would like to use, the two below are
//just testing what happens when I try a differant approach
%heart.setTransform("-90 -2 11 0 0 1 20");
echo(%heart.getTransform());
%heart.setTransform("-90 -2 11 "@ %rx SPC %ry SPC %rz @" 30");
echo(%heart.getTransform());
}
The object's handle number is set to $t.
I run the function as Turn($t,0,0,0,30)
And the results of the echo's are:
-90 -2 11 1 0 0 0 (why is the x rotation one and the z rotation 0? And why isn't the final value 20?)
-90 -2 11 0 0 1 1.15 (why 1.15 and not 20?)
-90 -2 11 1 0 0 0 (again, x and z should be switched. Also, the final value should be 20)
I have no idea what in shiva's name is going on- can someone help?