-
I want to achieve the effect where a flat shape in 3d is always aligned to the camera such that it stays a flat shape, like in old games a sprite in 3d. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
What you're referring to is called billboarding. It is usually achieved using a custom vertex shader. For example: If you want to rotate the quad instead, you can do that, it's just a bit unusual, but it will still work unless you have multiple cameras looking at the same sprite. |
Beta Was this translation helpful? Give feedback.
What you're referring to is called billboarding. It is usually achieved using a custom vertex shader. For example:
http://www.opengl-tutorial.org/intermediate-tutorials/billboards-particles/billboards/
If you want to rotate the quad instead, you can do that, it's just a bit unusual, but it will still work unless you have multiple cameras looking at the same sprite.
If I remember correctly, the rotation field of the
Transform
component has alook_at
method (or constructor, in that case you have to doQuat::look_at
), and put as the parameter the position of the camera.