Skip to main content

rotate

rotate() 

Rotates the transformation matrix on the z-axis by a given angle or other axes when specified.

// Rotate on z-axis
rotate(z: 45deg)
rect((-1,-1), (1,1))
// Rotate on y-axis
rotate(y: 80deg)
circle((0,0))

..angles:

โ€‹

A single angle as a positional argument to rotate on the z-axis by. Named arguments of x, y or z can be given to rotate on their respective axis. You can give named arguments of yaw, pitch or roll, too.

Origin to rotate around, or (0, 0, 0) if set to none.