LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: trimoq on July 05, 2013, 17:36:38

Title: Normals and VBO
Post by: trimoq on July 05, 2013, 17:36:38
Hey everyone,
i have encountered a problem while coding a small game.
No mater how i try, the normals won't work as they should.
After loading and parsing the .obj file, it drwas on screen but the lightning is still messed up.
Here are the important parts of the code:


glBindBufferARB(GL_ARRAY_BUFFER_ARB, normalBufferID);
GL11.glNormalPointer(GL11.GL_FLOAT, 12, 0);


and


glBindBufferARB(GL_ARRAY_BUFFER_ARB, bufferID);
glBufferDataARB(GL_ARRAY_BUFFER_ARB, bufferData,
GL_STATIC_DRAW_ARB);


The buffer consists of the data parsed from the .obj in floats and

I hope someone can help me with this issue,
thanks trimoq
Title: Re: Normals and VBO
Post by: quew8 on July 06, 2013, 06:36:00
1) We will need to see more code than that (for example, according to this, you are using two different buffers)

2) We will need a better description of the problem - Do the normals form some sort of pattern or is it just random? Have you checked they
    are the right normals before being put in the VBO? Are you sure it is the normals and not the lighting messing up and that you are using
    the normals int the right way? A picture is sometimes helpful.

3) Is a number.
Title: Re: Normals and VBO
Post by: Fool Running on July 08, 2013, 13:57:02
Also, if you are using shaders, it would help to see your shader code.