Skip to main content
gamedev.net
🔒 Locked

billboarding

Started by dande 2 replies 800+ views
Original Post
dande
dande
Hi, can someone please teach me on creating laser beam''s billboard. I am ok with creating billboard, like a tree, but I just cannot figure out laser beam''s billboard. Thanks!!
Dan FeketeThe Shadowhand Co.If everybody has it's own matrix, then mine is an identity
greeneggs
greeneggs
Good tutorial here: http://www.lighthouse3d.com/opengl/billboarding/
Trienco
Trienco
dont know how fast this is, but it works fine for me:

(i assume the z/front vector is the direction of the beam and y/up is its normal)

vec3 tmp=camera.position - billboard.position;
billboard.right=cross (tmp, billboard.front);
normalize(billboard.right);
billboard.up=cross(billboard.front, billboard.right);

either use it for the transformation matrix or to calculate the 4 corners. what this should do is aligning the billboards normal so it will intersect with your cameras view direction which should make it face the cam with its while width.

(you might have to change the order of some vectors in the cross products)
f@dzhttp://festini.device-zero.de
dande
dande
hi! thanks for all your posts. I am now ... ummm ... parsing them. The only problem most of the times, that the game has a rotateable lasergunturret (i am not so sure about the word, whatever), so the direction of the laserbeam is not always on the negative Z axis.
Dan FeketeThe Shadowhand Co.If everybody has it's own matrix, then mine is an identity

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.