Hi, I want to be able to draw some faces at paticular X,y,z coodinates and yet have them always face the camera for a particle engine. At the moment I’m using gluLookAt to position the camera but I don’t mind changing to simple tranlsations or rotations if thats the only way to do it. Thanks
Well, I do it like this…
I have a function that I pass in my current view angles. From that, it creates a forward, right, and up vector.
From here, you can use the right and up vector to calculate the vertices for your quad or triangles.
I can send some simple code to anyone that e-mails me on this topic.
The technique you described is referred to as a “Sprite”. Do a web search for it. Also check these links:
Search the discussion forum for “billboard”. This question has been asked many times and is probably in the FAQ…
Here’s the listing:
OpenGL FAQ / 9 Transformations
9.160 How can I transform an object so that it points at or follows another object or point in my scene?