Jump to content

Rotation: Difference between revisions

m
Use infobox, edit paragraphs
(Created page with "Similar to Vector, but for rotations instead of a position. The values represent an angle from 0 to 360, though you can use any value and it will loop around, so 361 will be the same as just using a 1. File:Rotation1.png It can be used to set the rotation of a block, angle of the camera, to rotate a vector, among other things. Rotations are applied in Y,X,Z order, this means that a block with a rotation of (45, 10, 25), will first be rotated on Y by 10°, then...")
 
m (Use infobox, edit paragraphs)
 
Line 1: Line 1:
Similar to [[Vector]], but for rotations instead of a position. The values represent an angle from 0 to 360, though you can use any value and it will loop around, so 361 will be the same as just using a 1.
{{Block
|image=Rotation.png
|type=s
|folder=Values
|output1={{Port|r}}
}}


[[File:Rotation1.png]]
Similar to a [[vector]], but for rotations instead of a position.
The values represent an angle in degrees, from 0 to 360, though you can use any value and it will loop around, so 361 will be the same as just using a 1.


It can be used to set the rotation of a block, angle of the camera, to rotate a vector, among other things.
It can be used to set the rotation of a block, angle of the camera, to rotate a vector, among other things.


Rotations are applied in Y,X,Z order, this means that a block with a rotation of (45, 10, 25), will first be rotated on Y by 10°, then on x by 45°, and finally on Z by 25°. This can sometimes make it hard to get the right angle you want, so keep it in mind.
Rotations are applied in Y, X, Z order.
This means that a block with a rotation of <code>45, 10, 25</code>, will first be rotated on Y by 10°, then on X by 45°, and finally on Z by 25°.
This can sometimes make it hard to get the right angle you want, so keep it in mind.


Internally, rotations are represented as [quaternions](https://en.m.wikipedia.org/wiki/Quaternion).
Internally, rotations are represented as [https://en.wikipedia.org/wiki/Quaternion quaternions].


== Related ==
== Related ==
Line 14: Line 22:
* [[Vector]]
* [[Vector]]
* [[Truth (True & False)]]
* [[Truth (True & False)]]


[[Category:Blocks]]
[[Category:Blocks]]