Updated Frame (markdown)

bi0qaw 2017-11-22 23:11:31 +01:00
parent ff18155ec3
commit 12d8972017

@ -13,7 +13,7 @@ command /halo:
set {_circle-locations::*} to location 1 above player's head offset by {_rotated-circle::*}
show happy villager at {_circle-locations::*}
```
All the magic happens in lines 3 and 5. In line 3 we grab the frame of the player and in line 5 we rotate our vectors with the frame. A frame is nothing else than a mini coordinate-system that stores the orientation of an entity. The expression `%vectors% in %frame%` just tells Skript to use the coordinate system of the frame instead of the standard Minecraft coordinate system. This is illustrated by the following picture where the flame particles indicate the three axes of the frame.
All the magic happens in lines 3 and 5. In line 3 we grab the frame of the player and in line 5 we rotate our vectors with the frame. A frame is nothing else than a mini coordinate-system, in our case the coordinate system of the player's orientation. The expression `%vectors% in %frame%` just tells Skript to use the coordinate system of the frame instead of the standard Minecraft coordinate system. This is illustrated by the following picture where the flame particles indicate the three axes of the frame.
![](https://i.imgur.com/lDHaMOm.png)
@ -23,7 +23,7 @@ You can see that the circle is still in the "*horizontal*" XZ-plane but the whol
* When you need the same shape in multiple directions
* When you need to update the direction of a shape over and over again
* When you need to rotate a lot of points
* When it is more convenient to you
* When you feel it is more convenient than a rotation
Note that frames do not completely replace rotations. I tend to use rotations during the creation stage of a shape and then get the final orientation with a frame. Let's illustrate this with the example of the circle around the player's head. What if want a circle that goes vertically around the player's head and not horizontally? It is possible to achieve this with frames only but you will have to deal with a lot of annoying yaw/pitch problems. The solution to this is that you first get a vertical circle and then show it in the frame of the player:
```