billboarding techniques

ghettotek
Unregistered
 
Post: #1
does anybody have any examples or can anybody explain how to achieve the billboarding effect. im implementing a particle system based on 2D polygons, and i figured the best way to keep things fast is to keep the polygons facing the viewport (billboard effect, instead of perhaps drawing several polygons at different angles for each particle). all the tutorials i find involve blending and whatnot, which i find odd; shouldnt this be more of a math thing? thanks.
Quote this message in a reply
lpetrich
Unregistered
 
Post: #2
I've had the same problem of billboard support for the Aleph One project; I'm the one that implemented OpenGL support for the Marathon engine. I've had to create the following transformation matrices:

World-to-eye
Eye-to-screen
Screen-to-clip

World means the game world's coordinates.

Eye means those coordinates with the viewpoint at the origin and with the axes along directions related to one's view (x = along screen x, y = along screen y, z = perpendicular depth).

Screen means the first two coordinates (x,y) mapping onto a pixel position.

Clip means the final result: coordinates inside of the default clipping box of (-1,1) in all three dimensions.

For doing a billboard, here is what you can do:

Take its world-coordinate position and do world-to-eye.

From its eye-coordinate position, do appropriate amounts of displacement in the view-vector-perpendicular coordinates (not in the depth coordinate!), and use the displaced points to construct the vertices.

Render your billboard with those vertices and with your eye-to-clip transformation.

That will ensure that your billboards are appropriately sized. If you want a fixed size in screen space, as with a caption, you do much like the above, but into screen instead of eye space.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #3
Search the forums. It's been answered before.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Screen-space techniques mattz 4 4,198 Nov 6, 2008 08:55 PM
Last Post: Bachus
  Vertex shader particle billboarding question TomorrowPlusX 3 5,810 Sep 15, 2008 06:46 AM
Last Post: TomorrowPlusX
  2d Game techniques lfalin 9 5,733 May 3, 2007 10:04 AM
Last Post: lfalin
  2D game techniques in OpenGL Wowbagger 7 8,896 Aug 5, 2006 05:06 PM
Last Post: akb825
  billboarding question rhiannon 5 3,610 Mar 11, 2005 02:13 PM
Last Post: OneSadCookie