Normals and VBO

Started by trimoq, July 05, 2013, 17:36:38

Previous topic - Next topic

trimoq

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

quew8

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.

Fool Running

Also, if you are using shaders, it would help to see your shader code.
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D