SwiftUI: Rotation 3D Effect on the Y Axis

Mark Moeykens
Oct 9, 2019
This is very similar to rotation on the X axis. If you carefully observe the parameters you will notice that only the y parameter has a value.

Basically, what's happening here is you are drawing a line (vector) from the center of a graph to 1 on the Y axis.

If you plot a point on the Y axis (1) and draw a line (vector), this becomes the line that the view is rotated around.

This vector is going through the center of the view.



Going through the center of the view is the default, no matter which vector you draw. This line is "anchored" to the center. But you can change this anchor which you will see later in this series.

Free SwiftUI Picture Book



Screenshots for every code example? Yes! Get your FREE SwiftUI picture book here.