Like the previous tutorial (Unity – Draw a Debug Sphere), this one continues expanding our understanding of drawing 3D debug shapes. This tutorial will cover how to draw debug cubes and rectangular cuboids using a few different approaches, while still keeping the code clean and easy to understand. Cubes are often seen in, and associated with, games and 3D graphics, so it only makes sense to...
Unity – Draw A Debug Sphere
Through the previous tutorials, we have covered how to draw 2D shapes in 3D space. Now, we are encroaching into the realm of 3D shapes. First shape (and potentially the most useful) is a sphere. In a context of game development, a number of use-cases is almost unlimited, including explosion radius, hearing radius of some AI agent, “safe” area, etc. Sphere Approximation As with the...
Unity – Draw A Debug Rectangle
After covering circle and triangle in previous tutorials, we can continue with another geometric shape commonly used in game development, a rectangle. In this tutorial you will learn how to debug draw a rectangle in 3D space using various input parameters. This tutorial is a part of Unity– Draw Custom Debug Shapes series. I would suggest to check the previous tutorials too, since they explain...
Unity – Draw A Debug Triangle
As many of you know, a triangle drawn in three-dimensional space is a foundation of 3D graphics. As such, it can be useful to be able to draw different types of triangles within your Unity project and to understand their properties. Through this tutorial we will cover four different approaches for drawing triangles: Triangle defined by three points in 3D space,Isosceles triangle defined by its...
Unity – Draw A Debug Circle – Wrap-up
Through the previous four parts of this tutorial we have seen how to draw a debug circle in Unity, how to rotate it in 3D space and how to draw arcs, segments and sectors of a circle. In this part we will cover some basic C# concepts to make the extension functions a bit more useful and convenient. Examples show in this tutorial are just a first step from which you should be able to modify the...