Archived

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

Eber Kain

Several non-newbie questions

Recommended Posts

First, can someone show me how to set up a glutTimerFunc Is there a better way to draw this, and still be able to use the colors as i do. for (int z = -10; z<10; z++) { for (int y = -10; y<10; y++) { glLoadMatrixf(cam.m); glTranslatef(0,y,z); glBegin(GL_POINTS); for (int x = -10; x<10; x++) { if (builder.x == x && builder.y == y && builder.z == z) glColor3f(1,0,0); else if (builder.z == z) glColor3f(0.8,0.8,0.8); else glColor3f(0.3,0.3,0.3); glVertex2f(x,0); } glEnd(); } } What image format should i use for my particles, and whats the fastest way to draw them. home.earthlink.net/~eberkain/

Share this post


Link to post
Share on other sites
I think that each registration of glutTimerFunc only gives one callback. Another option is to use glutGet(GLUT_ELAPSED_TIME) for timing purposes.

Push and Pop can perhaps be faster than LoadMatrix.
It is faster to use vertex arrays and update the part of the arrays you are changing each frame.

Share this post


Link to post
Share on other sites