Proper way to make immediate mode follow a gameobject
Is there a proper way to draw stuff in immediate mode while following a gameobject or am I better off just using the components?
Also, how would you draw a polygon in X, Z instead of X, Y using immediate mode.
Immediate mode is intended to be updated every frame, but if you want it to follow an object or a transform, the easiest way is to set:
Draw.Matrix = transform.localToWorldMatrix;
// draws in local space here
Draw.ResetMatrix(); // to make sure other immediate mode drawing doesn't follow the object
as for drawing in XZ, you would set a new rotation of the object using the same matrix system, since polygons are always flat in their local XY space