SFML community forums

Help => General => Topic started by: molmasepic on February 22, 2011, 12:09:12 am

Title: Bad rendering?
Post 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
Title: Bad rendering?
Post by: Groogy on February 22, 2011, 12:33:12 am
Could you highlight what is the problem?
Title: Bad rendering?
Post by: molmasepic on February 22, 2011, 12:40:35 am
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:

Code: [Select]
#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..
Title: Bad rendering?
Post by: molmasepic on February 22, 2011, 07:48:53 am
nobody knows? ._.
Title: Bad rendering?
Post by: devlin on February 22, 2011, 08:46:55 am
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)
Title: Bad rendering?
Post by: molmasepic on February 22, 2011, 09:21:23 pm
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/
Title: Bad rendering?
Post by: devlin on February 23, 2011, 07:56:09 am
And if you comment out these lines?
Code: [Select]
glEnable(GL_POLYGON_STIPPLE);
Title: Bad rendering?
Post by: molmasepic on February 28, 2011, 07:28:18 pm
Quote from: "devlin"
And if you comment out these lines?
Code: [Select]
glEnable(GL_POLYGON_STIPPLE);



same problem
Title: Bad rendering?
Post by: molmasepic on February 28, 2011, 07:56:59 pm
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?
Title: Bad rendering?
Post by: devlin on March 01, 2011, 11:18:25 am
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?