Original Post
🔒 Locked
billboarding
Advertisement
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)
(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)
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement