Created Rotate (markdown)
parent
662539d191
commit
e195d38257
57
Rotate.md
Normal file
57
Rotate.md
Normal file
@ -0,0 +1,57 @@
|
||||
## Vectors
|
||||
|
||||
```
|
||||
%vectors% rotated around (x|y|z)-axis by %number%
|
||||
%vectors% rotated around %vector% by %number%
|
||||
```
|
||||
|
||||
## Locations
|
||||
|
||||
```
|
||||
%locations% rotated around (x|y|z)-axis at %location% by %number%
|
||||
%locations% rotated around %vector% at %location% by %number%
|
||||
```
|
||||
|
||||
Rotates a list of locations or vectors around an axis by an angle in degree.
|
||||
|
||||
Obligatory example:
|
||||
```
|
||||
set {_line::*} to line with length 1 and density 5
|
||||
set {_rotated::*} to {_line::*} rotated around y-axis by 180
|
||||
```
|
||||
With locations:
|
||||
```
|
||||
set {_line::*} to line from player to location 1 in front of player with density 5
|
||||
set {_rotated::*} to {_line::*} rotated around y-axis at player by 180
|
||||
```
|
||||
Rotates the line around the y-axis by 180 degrees as shown in the image (green particles = original, flame particles = rotated):
|
||||
![](https://i.imgur.com/r0U5R7d.png)
|
||||
|
||||
Note that the rotation goes clockwise. If you want an anti-clockwise rotation you have to use a negative angle. If you want to rotate around another axis than the x-, y- or z-axis you have to get a vector along that axis.
|
||||
|
||||
Example:
|
||||
```
|
||||
set {_line::*} to line with length 1 and density 5
|
||||
set {_rotated::*} to {_line::*} rotated around vector 1, 1, 1 by 180
|
||||
```
|
||||
Note that this is not the same as:
|
||||
```
|
||||
set {_line::*} to line with length 1 and density 5
|
||||
set {_rotated::*} to {_line::*} rotated around x-axis by 180
|
||||
set {_rotated::*} to {_line::*} rotated around y-axis by 180
|
||||
set {_rotated::*} to {_line::*} rotated around z-axis by 180
|
||||
```
|
||||
|
||||
***
|
||||
|
||||
## Table showing the effect of the axis vector on the rotation
|
||||
|
||||
Rotation|Direction Vector
|
||||
---|---
|
||||
clockwise rotation around x-axis|1, 0, 0
|
||||
clockwise rotation around y-axis|0, 1, 0
|
||||
clockwise rotation around z-axis|0, 0, 0
|
||||
anti-clockwise rotation around x-axis|-1, 0, 0
|
||||
anti-clockwise rotation around y-axis|0, -1, 0
|
||||
anti-clockwise rotation around z-axis|0, 0, -1
|
||||
|
Loading…
Reference in New Issue
Block a user