Jump to content
  • Advertisement

Archived

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

YartZ

Quads facing at the camera

This topic is 6263 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

Any tutorial somewhere where is explained how to make quads, triangles, polygons, whatever always facing at the camera? Or if someone can help me with this. -- YartZ

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
You can try this http://nate.scuzzy.net/docs/billboard/ and this http://nate.scuzzy.net/gltut/billboard.zip.

Share this post


Link to post
Share on other sites
Call this just before you draw the quad:


void Billboard(void)
{
float temp[16]={ 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f }, m[16];

glGetFloatv(GL_MODELVIEW_MATRIX, m);

temp[0]=matrix[0];
temp[1]=matrix[4];
temp[2]=matrix[8];
temp[4]=matrix[1];
temp[5]=matrix[5];
temp[6]=matrix[9];
temp[8]=matrix[2];
temp[9]=matrix[6];
temp[10]=matrix[10];

glMultMatrixf(temp);
}

Share this post


Link to post
Share on other sites
Is that faster than:

glGetFloatv(GL_MODELVIEW_MATRIX,m);
glLoadIdentity();
glTranslatef(m[12],m[13],m[14]);

?


Or do they do different things?



I do a LOT of these in my game, so maybe I''ll go ahead and try the other method to see if I can get a speed improvement...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
i have been messing with a program for a long time & cant seem to see the problem . the blue book thingy i downloaded from the www doesnt explain what the APIs do in realistic terms so im not sure what i am doing . i want to make 3D objects from 2D polygons using the maximum amount so the objects can be taken apart . i want the polygons to always face forwards but the objects have to rotate etc. . i want to make a loop so i dont have to rewrite the gltranslate x,y,z etc. more than once . i want it to be taken care of so all i have to do is program like i am using DMA with algebra,trig,logic in masm32 with formulas .
is that @ all possible ? what is , what isint ?
> steverowe5@aol.com or hotmail
are there any more explanitory examples of these APIs ?
i am a programmer only when there is documentation that is defined or with definitions .

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!