hy there
i tried to do a little terrain w/o lighting material settings and a texture at first, my prob is that you will see the “triangle strips” not the triangles but the strips…
here u will found a picture of my problem
http://www.geocities.com/ismirnichegal/opengl/Desktop3.jpg
ive rendered the picture in polygon fill mode, and give every vertex a color determined by the height…to simulate darker parts in deeper areas
bye
apo
system
August 25, 2003, 6:57am
2
It seems that on top of not posting any code from your program, the picture you posted isn’t online. It is a bit difficult to analize anything without those things.
i dont know why u cant reach the picture…i can (its not cached)
but here is the code u asked for…
glBegin(GL_TRIANGLE_STRIP);
for(row = 0; row < surface_rows-1 ; row++)
{
if(!reverse)
{
for(col=0; col < surface_cols-1; col++)
{
glColor3f(surface[row][col][3],surface[row][col][3],surface[row][col][3]);
glVertex3f( surface[row+1][col][0], surface[row+1][col][1], surface[row+1][col][2] );
glVertex3f( surface[row][col][0], surface[row][col][1], surface[row][col][2]);
}
}
else
{
for(col=surface_cols-2; col >=0 ; col--)
{
glColor3f(surface[row][col][3],surface[row][col][3],surface[row][col][3]);
glVertex3f( surface[row][col][0], surface[row][col][1], surface[row][col][2]);
glVertex3f( surface[row+1][col][0], surface[row+1][col][1], surface[row+1][col][2] );
}
}
reverse = !reverse;
}
glEnd();
i re-uploaded the file…
http://www.geocities.com/ismirnichegal/opengl/desk3.jpg
and i forgot to say…for the code above, i’ve used a matrix filled up with the vertices
bye
1234
August 25, 2003, 8:27am
5
Originally posted by apocalexiz:
[b]i re-uploaded the file…
http://www.geocities.com/ismirnichegal/opengl/desk3.jpg
and i forgot to say…for the code above, i’ve used a matrix filled up with the vertices
bye[/b]
www.geocities.com doesnt allow remote linking (I think) so go to http://www.geocities.com/ismirnichegal/opengl/ instead and you will get the images.
For what you did to render them, they look perfectly fine (the jpeg is pretty low quality though).
Perhaps you should tell us how you expected them to look like?
dorbie
August 25, 2003, 8:46am
6
You are missing a color this code:
glColor3f(surface[row][col][3],surface[row][col][3],surface[row][col][3]);
glVertex3f( surface[row+1][col][0], surface[row+1][col][1], surface[row+1][col][2] );
glVertex3f( surface[row][col][0], surface[row][col][1], surface[row][col][2]);
should look more like:
glColor3f(surface[row+1][col][3],surface[row+1][col][3],surface[row+1][col][3]);
glVertex3f( surface[row+1][col][0], surface[row+1][col][1], surface[row+1][col][2] );
glColor3f(surface[row][col][3],surface[row][col][3],surface[row][col][3]);
glVertex3f( surface[row][col][0], surface[row][col][1], surface[row][col][2]);
Same for the other loop.
This is compounded by an optical illusion, one of the Mach effects (I won’t call it banding since that’s a slightly different illusion IMHO).
dorbie
ahh…it works with the 2 glColor calls…
lol how could i forgot the second color…oh man…
thx folks