Bilboarding?
I've seen many a time the explination of:
Grab the Up and Right vector from the camera...
draw the sqaure using those.
But that looks wrong to say the least. When you are
standing still, and look around the bilboard tilts with
the looking.
So, how can you generate a bilboard that is always in
the plane purpendicular to the line from the camera
center to the object center, and having nothing to do with
the direction the camera is facing?
Hmm.. something like:
That should (hopefully) do the trick. [grin]
facingVector = cameraPos - billboardPos;upVector = (0, 1, 0); // global uprightVector = facingVector.cross(upVector);// up and right give billboard edges.// Generates 'cylindrical' billboards, all using global up (good for trees)// For spherical (totally facing camera):upVector = rightVector.cross(facingVector); // and overwrite old up.
That should (hopefully) do the trick. [grin]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement