PDA

View Full Version : Color coding



hungtx
09-22-2005, 09:27 PM
Hi everybody!
I have a 100x100 2D-array of oscillators. Each node(i,j) stores the phase of one oscillator. I want to use color to display the phase of oscillators so I have to draw a square of size 100x100. Each pixel of this square is corresponding to one oscillator.

I am a beginner at OpenGL and X-window programming so please help me!
Thanks a lot!

mikael_aronsson
09-22-2005, 09:50 PM
Hi !

glDrawPixels will render a ram area as an image, I assume you want to update each pixel pretty often so that is one solution, even though not very fast.

Another one is to render each pixel as a quad like:

glBegin( GL_QUADS);
glVertex...
...
...
...
glEnd();

Disable lighting and use glColor... to set the color of each quad.

Mikael