Align to Joystick for 3D Shapes!?
by Mike Kowalski · in Torque Game Builder · 11/09/2008 (12:23 pm) · 1 replies
Hi, been wracking my brain trying to figure out how to get 3D shapes working the way I want in TGB. My main problem is getting it to rotate the way I want, like the way a normal shape would.
What I have is a player model I have all rigged up and animated and working fine, and thru 3D shape rotation I adjusted the X axis by 75 so the camera is facing him at a slightly skewed top down angle. From there I was able to get him to rotate around that axis by setShapeAngularVelocity and adjusting the Z axis.
Unfortunately I don't think that actually orientates the shape itself, just the player model inside that magic box it floats in, beacuse when I attempted to move him based on setlinearvelocitypolar() he ignores the angularvelocity and still goes up and down.
I basically want to get the Align to Joystick behavior to rotate my player so I can shoot in the direction he's facing, but I have starring at it and really have no idea what to do with it, and would really like to find a solution of some sort that involves scripting only.
Thanks in advance for any help and for your time!
What I have is a player model I have all rigged up and animated and working fine, and thru 3D shape rotation I adjusted the X axis by 75 so the camera is facing him at a slightly skewed top down angle. From there I was able to get him to rotate around that axis by setShapeAngularVelocity and adjusting the Z axis.
Unfortunately I don't think that actually orientates the shape itself, just the player model inside that magic box it floats in, beacuse when I attempted to move him based on setlinearvelocitypolar() he ignores the angularvelocity and still goes up and down.
I basically want to get the Align to Joystick behavior to rotate my player so I can shoot in the direction he's facing, but I have starring at it and really have no idea what to do with it, and would really like to find a solution of some sort that involves scripting only.
Thanks in advance for any help and for your time!
About the author
Torque Owner Mike Kowalski
3dshape.setShapeAngularVelocity(0,0,player.getrotation());
It kinda works, but freaks out alot and throws the 3d shape into a free spin at some angles, and doesn't respond very accurately. Any suggestions would be great though :)