rotating an object around it's center
by Arinthian · in Torque 3D Beginner · 05/01/2013 (5:50 am) · 3 replies
Hello,
I've created a subclass of ShapeBase which I've called RotatingShape, which, essentially, rotates
it around the y axis over time, which works, but it seems to be that the shape that is rendered
is not centered around the origin of my object, so it doesn't rotate on the spot, but rather, spins
around the origin of RotatingShape.
from looking at the way the world editor rotates a TSStaticShape on the spot, it seems to change
the position of the object as well as the rotation of the shape, so I'm wondering how I could
either:
a) do this programatically for my RotatingShape, or
b) set the shape to render (and transform) around the origin on my RotatingShape
I couldn't find too much by skimming over other classes or searching the website, so I'm hoping someone
can help.
I've created a subclass of ShapeBase which I've called RotatingShape, which, essentially, rotates
it around the y axis over time, which works, but it seems to be that the shape that is rendered
is not centered around the origin of my object, so it doesn't rotate on the spot, but rather, spins
around the origin of RotatingShape.
from looking at the way the world editor rotates a TSStaticShape on the spot, it seems to change
the position of the object as well as the rotation of the shape, so I'm wondering how I could
either:
a) do this programatically for my RotatingShape, or
b) set the shape to render (and transform) around the origin on my RotatingShape
I couldn't find too much by skimming over other classes or searching the website, so I'm hoping someone
can help.
#2
the Full template of Torque 3D
(art/shapes/cube/cube.dae and art/shapes/rocks/rock1.dts specifically)
so I might mock up some test models in blender myself, make sure they are centered, and then see what happens.
thank you for the response.
05/01/2013 (11:26 pm)
okay, well the models I used to test this actually came fromthe Full template of Torque 3D
(art/shapes/cube/cube.dae and art/shapes/rocks/rock1.dts specifically)
so I might mock up some test models in blender myself, make sure they are centered, and then see what happens.
thank you for the response.
#3
seems I was just silly and assume the included models where centered.
one final question however, is it possible to obtain the width/height/depth of a shapeFile for the use of, for example, a custom offset in either script or c++ code?
once again, thank you for your response and help.
05/01/2013 (11:33 pm)
well, I just tested a model I exported myself and it worked perfectly.seems I was just silly and assume the included models where centered.
one final question however, is it possible to obtain the width/height/depth of a shapeFile for the use of, for example, a custom offset in either script or c++ code?
once again, thank you for your response and help.
Associate Ron Kapaun
3tdstudios.com
Ron