How to rotate a cube in the scene
by Alessandro · in Torque 3D Beginner · 04/02/2013 (12:44 am) · 28 replies
Hello,
I was studying T3D and I tried to put a simple cube in the scene, then I wanted to let it rotate.
You can imagine a pesudo-code like this:
function CUBE::OnUpdate() {
rotation.x += 0.1;
}
I wish to rotate the cube of a little bit at every frame.
But...
1) I cannot understand how to implement/detect the callback OnUpdate (does it exist?).
2) Cannot understand how I can rotate the cube of a little bit. I think I need to use setTransform().
Thank you for your help!
I was studying T3D and I tried to put a simple cube in the scene, then I wanted to let it rotate.
You can imagine a pesudo-code like this:
function CUBE::OnUpdate() {
rotation.x += 0.1;
}
I wish to rotate the cube of a little bit at every frame.
But...
1) I cannot understand how to implement/detect the callback OnUpdate (does it exist?).
2) Cannot understand how I can rotate the cube of a little bit. I think I need to use setTransform().
Thank you for your help!
#22
What is the Red Object That popped out when the Player stepped on the mine? I have little or no knowledge about Explosives so i was just wondering what the Object was.
Thanks for Reading...
04/06/2013 (5:43 am)
[img="http://www5.picturepush.com/photo/a/12619548/img/12619548.jpg"]What is the Red Object That popped out when the Player stepped on the mine? I have little or no knowledge about Explosives so i was just wondering what the Object was.
Thanks for Reading...
#23
04/06/2013 (9:35 am)
@Akash: that is a healthkit or healthpatch that the player drops on death. That reminds me... that whole mechanic should be redone.
#24
04/06/2013 (5:38 pm)
Quote:If you isolate the game developer from the math involved in making a game, you create a developer that can only develop within the confines of the isolation.On the other hand, there's a reason we don't all program in assembly any more (and shouldn't)! If I'm making a game, I want to spend my time making the game, not learning and writing boilerplate code. Programming is far enough advanced that we can give people powerful design tools, not just implementation tools.
#25
Thank you, i had never thought that the Player was supposed to drop a HeathKit.
I wonder when the T3D 3.0 will be released.. Can't wait to get my hands on the new and much improved Torque 3D 3.0...
04/06/2013 (6:19 pm)
Thank you, i had never thought that the Player was supposed to drop a HeathKit.
I wonder when the T3D 3.0 will be released.. Can't wait to get my hands on the new and much improved Torque 3D 3.0...
#26
FWIW, I took matrices in college, but don't remember how to use them (I would have to pull out a book to understand how to calculate them). I just have vague memories of what they can do. That vague understanding is enough. So we are not talking a whole lot of in depth math here. Mostly concepts on usage.
04/06/2013 (7:38 pm)
Quote:I want to spend my time making the gameAgreed. Knowing how matrix math (and other generic gaming math concepts) can help, will help to make that possible. That comment was not intended to be condescending, so I apologize if it was.
FWIW, I took matrices in college, but don't remember how to use them (I would have to pull out a book to understand how to calculate them). I just have vague memories of what they can do. That vague understanding is enough. So we are not talking a whole lot of in depth math here. Mostly concepts on usage.
#27
Please can you help me, since rotation scripting could be very slow for intensive jobs!
THank you!
08/23/2013 (9:03 am)
Hello, can someone implement e decent rotation function in C++ source code of the engine, then distribute it?Please can you help me, since rotation scripting could be very slow for intensive jobs!
THank you!
#28
It would not be as generic a solution as script would be. Right now the script version will work with any displayable object.
What is so slow about the script version?
The speed setting is there to make it rotate faster or slower. Use it as a throttle for each object. You don't need a fine amount of resolution.
There are objects that have spin designed into them. One of those is the item object. But I am not sure you can control the speed of its rotation.
08/23/2013 (12:48 pm)
@Allesandro,It would not be as generic a solution as script would be. Right now the script version will work with any displayable object.
What is so slow about the script version?
The speed setting is there to make it rotate faster or slower. Use it as a throttle for each object. You don't need a fine amount of resolution.
There are objects that have spin designed into them. One of those is the item object. But I am not sure you can control the speed of its rotation.
Torque Owner Richard Ranft
Roostertail Games
The "Make My Game" button is coming soon....
Some light reading until the button is finished.