PDA

View Full Version : Unexplainable errors in image



Jonathan Berry
11-04-2010, 04:13 PM
Hi folks,

I'm new to OpenGL, and I'm currently trying to display the contents of some geometry arrays that have been created using a Wavefront file (.obj) to OpenGL Perl converting script.

The geometry will display on the screen, but theres some big unexplainable artifacts in the image. It only happens when the object is rotated substantially to the diagonal.

Below is an image of three screen shots, showing how the artifacts depend on the rotation of the object...

IMAGE (http://johnsjcr.org.uk/files/ScreenShots.jpg)


My mind is jumping to thoughts of Depth Buffering, Materials and Lighting. But I'm such a newb that I'm not sure where to start. Everything seems to be in working order as far as I can see.

The main code can be found >>here<< (http://johnsjcr.org.uk/files/mainUpdated.txt), and the header file with the geometry arrays >>here<< (http://johnsjcr.org.uk/files/Iphone.txt).

Any help would be massively appreciated!

Thanks in advance!

JB

bcthund
11-04-2010, 05:25 PM
From looking at just the screenshot you have, it looks very much like a coplanar primitive problem. That is, it's possibly drawing multiple primitives in the same place and they are fighting to be in front.

If that is the case, then you could have duplicate primitives that aren't supposed to be there or if they are supposed to be there then you need to look into polygon offset to correct the problem.

blink
11-04-2010, 06:18 PM
You also forgot to enable GL_NORMAL_ARRAY.