Update
This commit is contained in:
parent
6e779ad9b4
commit
30c8fea0b2
10 changed files with 59 additions and 29 deletions
31
billboard.md
31
billboard.md
|
@ -2,10 +2,37 @@
|
|||
|
||||
In [3D](3d.md) [computer graphics](graphics.md) billboard is a flat image placed in the scene that rotates so that it's always facing the camera. Billboards used to be greatly utilized instead of actual [3D models](3d_model.md) in old [games](game.md) thanks to being faster to render (and possibly also easier to create than full 3D models), but we can still encounter them even today and even outside retro games, e.g. [particle systems](particle_system.md) are normally rendered with billboards (each particle is one billboard). Billboards are also commonly called *[sprites](sprite.md)*, even though that's not exactly accurate.
|
||||
|
||||
There are two main types of billboards:
|
||||
By axis of rotation there are two main types of billboards:
|
||||
|
||||
- Ones **rotating only about vertical axis**, i.e. billboards that change only their [yaw](yaw.md), they only face the camera in a top-down view of the scene. Such sprite may deform on the screen (when the camera is at different height level) just like 3D models do and when viewed completely from above will disappear completely. This may in some situations look better than other options (e.g. in [games](game.md) enemies won't appear lying on their back when seen from above).
|
||||
- **Freely rotating** ones, i.e. ones that change all three [Euler angles](euler_angle.md) so that they ALWAYS face the camera from any possible angle. There may further be other two subtypes: billboards that align themselves with the camera's projection plane (they simply rotate themselves in the same way as the camera) which always end up on the screen as an undeformed and unrotated image, and billboards that face themselves towards the camera's position and copy the camera's [roll](roll.md) (though these may seem like two same things, they are not, for the latter we need to know the camera and billboard's positions, for the former we only need the camera's rotation). For simplicity we usually choose to implement the former, though the latter may result in look closer to that which would be produced by an actual 3D model of the object (e.g. a sphere projected to an ellipse by perspective).
|
||||
- **Freely rotating** ones, i.e. ones that change all three [Euler angles](euler_angle.md) so that they ALWAYS face the camera from any possible angle.
|
||||
|
||||
Furthermore there is another subdivision into two main types by HOW the billboards rotate:
|
||||
|
||||
- **Projection plane aligned**: These billboards always align their orientation with the camera's projection plane (they simply rotate themselves in the same way as the camera) which always end up on the screen as an undeformed and unrotated image. This is simple to implement, we can simply [blit](blit.md) a 2D image on the rendered 3D view.
|
||||
- **Camera position facing**: These billboards face themselves towards the camera's position and copy the camera's [roll](roll.md).
|
||||
|
||||
Though the two types above may seem like two same things at first glance, they are in fact not, for the latter we need to know the camera and billboard's positions, for the former we only need the camera's rotation. For simplicity we usually choose to implement the former (projection plane aligned), though the latter may result in look closer to that which would be produced by an actual 3D model of the object.
|
||||
|
||||
```
|
||||
projection plane aligned position facing
|
||||
|
||||
| \
|
||||
| |
|
||||
| \
|
||||
|
||||
_.'| | _.'| |
|
||||
<:_ | | <:_ | |
|
||||
'.| | '.| |
|
||||
camera camera
|
||||
| /
|
||||
| |
|
||||
| | _ /
|
||||
| _.-'
|
||||
|
|
||||
```
|
||||
|
||||
*Projection plane aligned vs position facing billboards.*
|
||||
|
||||
Some billboards also choose their image based on from what angle they're viewed (e.g. an enemy in a game viewed from the front will use a different image than when viewed from the side, as seen e.g. in [Doom](doom.md)). Also some billboards intentionally don't scale and keep the same size on the screen, for example health bars in some games.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue