Drawing an Arc with Z as Y

Avatar
  • updated

In my scene, x represents the horz position, y is the height from the ground, and y is vert. I've been able to use Draw.Line and Draw.Quad because I can specify location using Vector3, but the Draw.Arc seems to draw using x,y when I really need x,z--so the arc is displayed, but it's flipped. How can I get it to draw using x,z? Thanks!

Reporting a bug? please specify Unity version:
Reporting a bug? please specify Shapes version:
Reporting a bug? please specify Render Pipeline:
Built-in render pipeline
Avatar
Freya Holmér creator

There are two ways

// option 1: rotate the arc using a quaternion
Quaternion rotXYtoXZ = Quaternion.Euler( 90, 0, 0 );
Draw.Arc( pos, rotXYtoXZ, radius, angStart, angEnd );

// option 2: rotate the drawing matrix
using( Draw.MatrixScope ) {
Draw.Rotate( rotXYtoXZ );
// all 2D drawing in here will be placed on the XZ plane
Draw.Arc( pos, radius, angStart, angEnd );
}