I have a game that is more or less 2D, but rendered in 3D. The camera hovers above the 2D game field tilted about 20 degrees from perfectly perpendicular to give a little 3D perspective to it.
I have some sprites that need to be rendered perfectly square, because they represent spherical objects. My first approach rendered quads flat on the 2D field which positioned them properly, but the sprite was subject to perspective distortion and it didn't always look round.
My current approach is that when rendering the sprites I move the camera to be perpendicular to the game field (and the sprites) which guarantees that the quads are never distorted by perspective. The drawback being that the position of the sprites is slightly different from where they would be if the camera was tilted.
So, how can I render sprites that are:
You can achieve what you want using a polygon which faces the camera at all times. This is called a "billboard". Here is a nice tutorial which seems to explain the math involved and how to implement it using OpenGL
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With