Problem with billboarding

This is a discussion on Problem with billboarding within the Game Programming forums, part of the General Programming Boards category; I've tried getting billboarding to work, it seems easy enough, but no matter what I do it doesn't actually work. ...

Problem with billboarding

I've tried getting billboarding to work, it seems easy enough, but no matter what I do it doesn't actually work. The bitmaps seem to somewhat turn with the camera but they are never actually completely perpendicular.

Here is what I have so far, what am I doing wrong? It's probably something incredibly obvious.

yes, that's what billboarding does. what's really supposed to happen is you're supposed to reverse the effects of the model view matrix by multiplying by its inverse. Instead (from ogl game programming) you can get the current up and right vectors from the modelview matrix, and use those to create the texture mapped quad. If you use components from the up and right vectors from the modelview matrix to set the vertices of the quad then the quad will always be facing the camera. I know I'm prolly doing something really stupid wrong. fuk

You left your caps-lock on,
Never knew that was called billboarding well, Why go through
all the fuss for something simple like that? If i'm not mistaken,
You can use orthographic graphics for 2D things like billboards,
Otherwise just use a simple quad and keep track of any rotation
and apply to reverse of any rotation to the billboard.

you can't have a z component when you go into 2d ortho mode therefore that will not work, and this is actually the simplest method. i was hoping someone who had already done billboarding could check this out and correct me where i am wrong.

I have tried using what the original model view matrix would be and what the transpose would be. i.e:
Vector up(MVMAT[0], MVMAT[1], MVMAT[2]);
Vector right(MVMAT[4], MVMAT[5], MVMAT[6]);

anyway I think the problem was because
1) I am a dumbass
2) I left out the Z component of the billbaord. I left my laptop at school though so I can't finish it.

EDIT: well I got it working, that's what the problem was, no biggie. I'll post it sometime when I've made some more updates, if you want.

travis you should help me think of ideas for this game, i.e I was thinking of having the weapons be billboarded bitmaps that travel in a sine wave, just like the railgun from quake II. You should help me think of stuff like that.