From e195d382578c1bacca73ac018cb90676c4f51d58 Mon Sep 17 00:00:00 2001 From: bi0qaw Date: Sat, 25 Nov 2017 16:22:28 +0100 Subject: [PATCH] Created Rotate (markdown) --- Rotate.md | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Rotate.md diff --git a/Rotate.md b/Rotate.md new file mode 100644 index 0000000..1e54b91 --- /dev/null +++ b/Rotate.md @@ -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 +