Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to make an axis-aligned billboard with Pyglet. I have looked at several tutorials, but they only show me how to get the up, right, and look vectors. So far this is what I have:

target = cam.pos
look = norm(target - billboard.pos)

right = norm(Vector3(0,1,0) * look)
up = look * right

  look.x, look.y, look.z,
  self.pos.x, self.pos.y, self.pos.z,
  up.x, up.y, up.z

This does nothing for me visibly. Any idea what I'm doing wrong?

share|improve this question
gluLookAt defines where your camera is looking at, not where the object is facing. – Jimmy Sep 12 '12 at 17:15
Typically, when one says "axis aligned", they are referring to the global axis. I know that you mean the axis of the camera, but it'll be good to know for future reference. – Byte56 Sep 12 '12 at 17:37
will do... thank you – user19787 Sep 17 '12 at 2:57
up vote 2 down vote accepted

I tried out billboards a while back. I just created a quad that faced the camera. Using the position I want the object at and the up and right vectors (normalized) of the camera, you can set the four corners of the quad like so:

a = position - ((right + up) * scale);
b = position + ((right - up) * scale);
c = position + ((right + up) * scale);
d = position - ((right - up) * scale);

Where a, b, c and d define the corners, use them clockwise or counter-clockwise depending on the winding order of your graphics library.

The right can be derived from the cross product or the look and the up vectors.

share|improve this answer
this is how I've done it as well, you might want to add that you can derive 'right' based on the cross product of the camera direction versus "true up", etc. – Jimmy Sep 12 '12 at 17:19
awesome... thanks – user19787 Sep 12 '12 at 17:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.