Help with Culling!

Started by Spilli, August 30, 2011, 16:57:56

Previous topic - Next topic

Spilli

Hi, I've been using LWJGL for around a week now and been experimenting with different ways to render vertices. I've found some quite useful tutorials which have helped me while creating my project, I've been struggling with optimizing my project as I'm unable to get any type of culling working. I've added my vertices in a clockwise format, here is some of settings I've already stated while initializing:

glEnable(GL_CULL_FACE);
		glEnable(GL_DEPTH_TEST);
		glDepthFunc(GL_LEQUAL);

		glFrontFace(GL_CW);
		glCullFace(GL_BACK);


I'm rendering the vertices using a VBO, and my camera is a custom class using:

        glTranslatef(camera.getX(), camera.getY(), camera.getZ());
        glRotatef(camera.getPitch(), 1.0f, 0.0f, 0.0f);
        glRotatef(camera.getYaw(), 0.0f, 1.0f, 0.0f);


My culling comes out really weird and I've tried following many different tutorials and had no luck.

Thanks, any help would be appreciated.