Discussion:
Billboard in front of 3D object
(too old to reply)
Márcio Laubstein
2013-11-23 18:15:23 UTC
Permalink
Hello everyone, I am currently facing a rendering problem. In our game, the character is a sprite rendered on a plane, living in a 3D world. The plane is a billboard always facing the camera, camera which is over his head. So, the plane is almost horizontal to show a character standing vertically. It provokes visual problems when the billboard goes through a wall:

Loading Image...

I had tried the solution leaving the rotation matrix of the billboard "upright", worked well, but of course depending on the height and angle of the camera toward the billboard it gets kinda flat, I tried to think of other possibilities, but none that I found it interesting, so if you already did something like it and can guide me to the right direction I would be very grateful. Thank you.

Maybe I can apply an offset towards the viewer camera could be a good solution but I will wait for other advices.
Márcio Laubstein
2013-11-25 16:05:37 UTC
Permalink
Post by Márcio Laubstein
http://s17.postimg.org/dyarbg18f/billboardissue.png
I had tried the solution leaving the rotation matrix of the billboard "upright", worked well, but of course depending on the height and angle of the camera toward the billboard it gets kinda flat, I tried to think of other possibilities, but none that I found it interesting, so if you already did something like it and can guide me to the right direction I would be very grateful. Thank you.
Maybe I can apply an offset towards the viewer camera could be a good solution but I will wait for other advices.
Anything would be really appreciated.
Márcio Laubstein
2013-12-17 01:10:19 UTC
Permalink
I ended up leaving the impostor with only the rotation on the y axis, it gets kinda flattened but I can stretch the quad vertically to make it look right relative to the angle of the camera, the Y scaling should be about 1.1547. It is (1 / cos30), which makes billboards look like original size from the camera with the angle of 30 degrees.
Loading...