Rotate
(Difference between revisions)
(Created page with "Rotates the object. The first 3 zeros are X,Y,Z values and the last is the angle. To increase rotating speed, put higher value at angle. Example 1 : Continuous rotation ...") |
|||
Line 1: | Line 1: | ||
− | Rotates the object. The first 3 zeros are X,Y,Z values and the last is the angle. | + | Rotates the object. The first 3 zeros are X,Y,Z values and the last is the angle.<br> |
+ | ''The "local" argument is optional (local coordinates), without it the transformation is global (global coordinates).'' | ||
To increase rotating speed, put higher value at angle. | To increase rotating speed, put higher value at angle. | ||
+ | |||
Example 1 : Continuous rotation | Example 1 : Continuous rotation |
Revision as of 20:44, 5 August 2012
Rotates the object. The first 3 zeros are X,Y,Z values and the last is the angle.
The "local" argument is optional (local coordinates), without it the transformation is global (global coordinates).
To increase rotating speed, put higher value at angle.
Example 1 : Continuous rotation
object = getObject("object") -- Scene update function onSceneUpdate() rotate(object, {0, 0, 1}, 1, "local") end
Example 2 : Rotation on key press (Space)
object = getObject("object") -- Scene update function onSceneUpdate() if isKeyPressed("SPACE") then rotate(object, {0, 0, 1}, 1, "local") end end