Sorry about the above post guys!!!!! My friends were joking around
To my question.
I have an block that is the player character. I want to rotate the block in object space around its axis. So for example when I press the left key it will rotate 90 degrees and fall on its side, when I press forward the up key it will fall forward and so on. The flash game bloxorz will give you an idea of what Im taking about.
http://www.miniclip.com/games/bloxorz/en/
If this was something like OpenGl I would know how to do it. You would have the block, translate it to (0,0,0) to get it in model space and rotate about the appropriate axis.
Unfortunately Im new to Torque and there are still a few things I need to figure out. Here's my first approach of trying to rotate the object on its side, more like an rough outline.
function rotateZ(%client)
{
%avatar=%client.player;
%currentTrans=%avatar.getTransform();
%theta= 0.57;//Or whatever the 90degrees is in radians
%rotB = "0 0 1 " SPC %theta;
Im hoping someone can say if they think I taking the correct approach to doing this properly in script? Would I need to use quaterions? Any advice would be appreciated!!
Torque Owner JJ62(#0005)
To my question.
I have an block that is the player character. I want to rotate the block in object space around its axis. So for example when I press the left key it will rotate 90 degrees and fall on its side, when I press forward the up key it will fall forward and so on. The flash game bloxorz will give you an idea of what Im taking about.
http://www.miniclip.com/games/bloxorz/en/
If this was something like OpenGl I would know how to do it. You would have the block, translate it to (0,0,0) to get it in model space and rotate about the appropriate axis.
Unfortunately Im new to Torque and there are still a few things I need to figure out. Here's my first approach of trying to rotate the object on its side, more like an rough outline.
function rotateZ(%client)
{
%avatar=%client.player;
%currentTrans=%avatar.getTransform();
%theta= 0.57;//Or whatever the 90degrees is in radians
%rotB = "0 0 1 " SPC %theta;
%matrix ="0 0 0" SPC %rotB;
%transform = getWords(%currentTrans, 0,2)SPC getWords(%matrix,3,6);
%avatar.setTransform(%transform);
}
Im hoping someone can say if they think I taking the correct approach to doing this properly in script? Would I need to use quaterions? Any advice would be appreciated!!