PDA

View Full Version : Vertex Color Ranges



Vasko
07-09-2004, 08:56 PM
Ok, lets say I have a vertex. Coordinate doesnt matter. And for that vertex I specify an RGB color value. Say, glColor3f(1.0f, 0.0f, 0.0f);
After i run the program, all my polygons (in fill mode) have some of that color on them.

Look here:

WHAT I HAVE:

http://www.vaskosoftware.fre3.com/center_messy.JPG

WHAT I WOULD LIKE:

http://www.vaskosoftware.fre3.com/center_neat.JPG

Thanx.

Regards,
Vasko

mikael_aronsson
07-09-2004, 10:11 PM
Pictures...... ?

Vasko
07-10-2004, 07:09 AM
Weird, it doesnt show them unless u right click, show picture. Sorry about that...

Regards,
Vasko

Vasko
07-10-2004, 09:35 AM
nevermind, I figured it out. I just made a loop, which cycles through my vertex array, and redraws each vertex with different glPointSize, and color.

Vasko

ZbuffeR
07-10-2004, 09:38 AM
What do you want to do with this red dot ?
Vertex colors are linearly interpolated along triangles edges.
If you really want only vertex colors, you have to change your grid. Make the 4 red vertices on a small square at center, with very near white vertices to limit the gradient. I suggest doing tests with
glPolygonMode( GL_FRONT_AND_BACK,GL_LINE); to better see the tesselation.

Or else scrap your polygon vertex colors, and only draw a single GL_POINTS red vertice, at the appropriate size.

By the way, what is your high level goal actually ?

EDIT: ok, you already figured it yourself.

Vasko
07-10-2004, 08:11 PM
My goal is to allow a user to see what vertex he/she are about to select, and what vertex has already been selected...