private void OnRenderObject() { GLE.BeginLines(); { GL.Color(ColorE.fuchsia); Quaternion rotation = transform.rotation; Vector3 position = transform.position + Vector3.up; GLE.DrawWireHemisphere(position, rotation, radius); GLE.DrawWireCone(position, rotation, radius, coneAngle, coneLength); } GL.End(); }
private void OnRenderObject() { if (skeleton == null) { return; } GLE.BeginLines(); { DrawSkeleton(skeleton); } GL.End(); }
private void OnPostRender() { GLE.BeginPixel(-50, 50, -50, 50); GL.Color(Color.red); GL.Begin(GL.TRIANGLES); GL.Vertex3(0, 0, 0); GL.Vertex3(0, 20, 0); GL.Vertex3(20, 20, 0); GL.Vertex3(20, 0, 0); GL.Vertex3(0, 0, 0); GL.End(); GLE.End(); }
private static void DrawSkeleton(StraightSkeleton skeleton) { GL.Color(Color.white); for (var polygonIndex = 0; polygonIndex < skeleton.polygons.Count; polygonIndex++) { Vector3 zOffset = Vector3.back * (skeletonPolygonOffset * polygonIndex); var skeletonPolygon = skeleton.polygons[polygonIndex]; for (int vertexIndex = 0; vertexIndex < skeletonPolygon.Count; vertexIndex++) { Vector2 current = skeletonPolygon[vertexIndex]; Vector2 next = skeletonPolygon.GetLooped(vertexIndex + 1); GLE.DrawLine((Vector3)current + zOffset, (Vector3)next + zOffset); } } }