Archived

This topic is now archived and is closed to further replies.

billboarding problem

This topic is 5591 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, Has anyone had problems with billboarding, namely with the fact that the billboarded face starts to "wrap" or "break" under certain angles if something else besides itself (and other billboarded faces) is drawn into the scene (as if one of the triangles in the quad is drawn under a right angle to the other one, leaving only 1 triangle visible)... This is giving me quite a headache. Maybe it''s my billboarding code which I wrote with the help of the GameTutorials article:
  
  TGLMatrix ModelViewMatrix;
  glGetFloatv(GL_MODELVIEW_MATRIX, ModelViewMatrix);

  TVector3f Right = TVector3f(ModelViewMatrix[0], ModelViewMatrix[4], ModelViewMatrix[8]);
  TVector3f Up = TVector3f(ModelViewMatrix[1], ModelViewMatrix[5], ModelViewMatrix[9]);

  TVector3f v1 = Position + ((-Right - Up) * Magnitude * 8);
  TVector3f v2 = Position + ((Right - Up) * Magnitude * 8);
  TVector3f v3 = Position + ((Right + Up) * Magnitude * 8);
  TVector3f v4 = Position + ((-Right + Up) * Magnitude * 8);
  
though it seems to work all by itself... And another question: the above code only allows billboarding of quads. What if I need to deal with random polygons? Can anyone give me directions where to look as Google seems to be scarce on billboarding info as it is. Thanks, Crispy

Share this post


Link to post
Share on other sites