PDA

View Full Version : opengl rendering mesh elements contour problem



AeroSujan
02-01-2010, 02:51 AM
Dear Friends
I am creating a set quad elements in opengl QT....assigning each point a distinct color and I am creating these elements in GL_FILL mode so I am getting a contour with different colors for different points. These colors are distributed smoothly over all the element. But in someportions I can see a thin black lines black circles are coming.My background color is black.The mesh is circular..I am not able to find the reason why these black lines or patches are appearing that affecting the overall looks of my contour.

Please help me someone in sorting out this.Any suggestions would be highly appreaciated. Thanks

Please see the code below.
//////////////////////////////////////////////////////
GLuint newlist = glGenLists(1);
glNewList(newlist, GL_COMPILE);
glEnableClientState(GL_COLOR_ARRAY);
glEnableClientState(GL_VERTEX_ARRAY);
glColorPointer(3,GL_FLOAT,0,colorPtr);
glVertexPointer(2, GL_FLOAT, 0, mesh_geom2.vertices);
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
glNewList(newlist, GL_COMPILE);
glDrawElements(GL_QUADS, ptsInBlock*ptsInBlock*blocks*4, GL_UNSIGNED_INT, indices);
glEndList();
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_VERTEX_ARRAY);
//////////////////////////////////////////////////////////////

strattonbrazil
02-01-2010, 09:47 AM
It's hard for me to imagine what you're getting without seeing it. Can you post a screenshot somewhere and link to it?

What does this mean?



But in someportions I can see a thin black lines black circles are coming.My background color is black.The mesh is circular


I assume you're making a ring-shape. If you change your background color, does it change the color of the lines and circles? If so, you have holes in the mesh. Otherwise, it's probably a color interpolation thing. Is blending turned on?

AeroSujan
02-02-2010, 12:12 AM
Dear Friend please check this link in QT centre there I have posted the picture of my mesh contour. You can see the mesh is fine but the contour is having black lines in normal direction. How can I remove them. My color Gradient is very smoother and gradual.I am assigning each point a color...

http://www.qtcentre.org/threads/27711-opengl-rendering-mesh-elements-contour-problem

strattonbrazil
02-02-2010, 05:34 PM
That definitely looks like an interpolation problem. Looking at how the areas are fading to black instead of just going black, I would think it's something to do with the data going in.

Is lighting on? Is this with a shader? I would check your data. Maybe set the color to white at various parts of the process. Like if you set all your data to the same thing (looks like you're using a lookup table), do you still get it? It looks like whatever transfer function you're using to map data to color is giving you that black and it's not a geometry problem.