Updated Reflect (markdown)

bi0qaw 2017-11-25 16:28:22 +01:00
parent 380c7e0020
commit c273182ff4
1 changed files with 28 additions and 26 deletions

@ -12,7 +12,33 @@ vectors %vectors% reflected at %vector% [in direction of %vector%]
Reflects locations or vectors in another location or vector.
Let's show this with some examples. First a simple reflection in the origin:
***
## Table showing effect of the direction vector on reflection
Transformation|Direction Vector
---|---
none|-1, -1, -1
reflection|1, 1, 1
x-axis reflection|-1, 1, 1
y-axis reflection|1, -1, 1
z-axis reflection|1, 1, -1
x/z-plane reflection|-1, 1, -1
y/z-plane reflection|1, -1, -1
x/y-plane reflection|-1, -1, 1
scaling by 2|-2, -2, -2
reflection and scaling by 2|2, 2, 2
reflection and scaling of x-axis by 2|2, 1, 1
reflection and scaling of y-axis by 2|1, 2, 1
reflection and scaling of z-axis by 2|1, 1, 2
move all points to the center| 0, 0, 0
set values of x-axis to x-value of center| 0, -1, -1
set values of y-axis to y-value of center| -1, 0, -1
set values of z-axis to z-value of center| -1, -1, 0
***
Let's show some examples. First a simple reflection in the origin:
```
set {_line::*} to vector line from vector 0, 0, 0 to vector 1, 0, 0 and density 5
set {_reflected::*} to vectors {_line::*} reflected at vector 0, 0, 0
@ -40,31 +66,7 @@ set {_reflected::*} to {_line::*} reflected at player
And the resulting image (green particles = before, flame particles = after):
![](https://i.imgur.com/ntJhTs8.png)
We see that the line was mirrored along the z-axis. This is because the z-value of the direction vector was set to -1. The table in the next section shows how the direction vector will affect your reflection.
***
## Table showing effect of direction vector on reflection
Transformation|Direction Vector
---|---
none|-1, -1, -1
reflection|1, 1, 1
x-axis reflection|-1, 1, 1
y-axis reflection|1, -1, 1
z-axis reflection|1, 1, -1
x/z-plane reflection|-1, 1, -1
y/z-plane reflection|1, -1, -1
x/y-plane reflection|-1, -1, 1
scaling by 2|-2, -2, -2
reflection and scaling by 2|2, 2, 2
reflection and scaling of x-axis by 2|2, 1, 1
reflection and scaling of y-axis by 2|1, 2, 1
reflection and scaling of z-axis by 2|1, 1, 2
move all points to the center| 0, 0, 0
set values of x-axis to x-value of center| 0, -1, -1
set values of y-axis to y-value of center| -1, 0, -1
set values of z-axis to z-value of center| -1, -1, 0
We see that the line was mirrored along the z-axis. This is because the z-value of the direction vector was set to -1. The table at the top shows an overview of the effect of the direction vector on the reflection.