SFML community forums
Help => General => Topic started by: molmasepic on February 22, 2011, 12:09:12 am
-
hey this is about opengl.
anyone know about this?
http://img208.imageshack.us/i/glitcheo.jpg/
if you know how to solve this then share some knowledge xD
thanks
-
Could you highlight what is the problem?
-
hm...its a bit hard to explain
basically when i go to run my game, the model looks badly rendered..
thats supposed to be a model, but it looks like its graphically bugged..
heres some code that i used that involves that model:
#import ".\WorldMap3Dv1.h"
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, WorldMap3Dv1Verts);
glTexCoordPointer(2, GL_FLOAT, 0, WorldMap3Dv1TexCoords);
glDrawArrays(GL_TRIANGLES, 0, WorldMap3Dv1NumVerts);
at first i thought it was the graphics card not liking it, but when i used this on my main computer it did the same thing..
any ideas now?
Theres spaces between the model, and alot ._.
Extra details: I used an obj2opengl.perl to load the obj file into a header file(.h)
its probably something wrong with that..
-
nobody knows? ._.
-
You really would have to include something that we can compile and test for us to have any chance of helping you.
At first glance - your model loader is not working properly.
What compiler are you using? (or are you using Objective-C?)
I notice you're using #import rather than #include which differs between compilers in what it does. (GCC uses it as a sort of #pragma once directive and visualC++ uses it for COM and .NET stuff only)
-
ok heres main: http://pastebin.com/ZKMW28Dy
and heres the model.h: http://www.mediafire.com/?uu40kuophpsczda
EDIT: heres a better picture: http://img403.imageshack.us/i/glitch2p.jpg/
-
And if you comment out these lines?
glEnable(GL_POLYGON_STIPPLE);
-
And if you comment out these lines?
glEnable(GL_POLYGON_STIPPLE);
same problem
-
ok i loaded a smaller model, and i noticed this
http://img27.imageshack.us/i/glitchrealized.png/
if you notice, it shows only one triangle on the mesh(the big triangle that is supposed to be a square.
also it has jagged edges on it, thats not supposed to be there.
im thinking that maybe theres a glitch with the face loading but im not sure
anyone?
-
Make sure your normals are facing the right way. You can see if that's the case by disabling GL_CULL_FACE.
Also, make sure your depth buffer have decent values in it - what's your near and far plane values?