Original Post
I was very proud to get lesson 10 working in LWJGL and its now working as presented. I'm now trying to learn how to place objects in the world and rotate them individually and independently from the world.
Based on what I've read with openGL. That is what the distinction between MODELVIEW and PROJECTION matrix modes is for.
Lesson 10 seems to rotate the entire world as one big model with MODELVIEW. So what i'm confused about is if I was to attempt to add a quad to the middle of the level and then rotate it with glRotatef that would rotate not only the quad but all of the walls, floors and everything else that is part of the scene. Not just the quad like I would like to try and do.
Since the heading and looking angle appear to be taken care of only by the below two lines:
GL11.glRotatef(lookupdown, 1.0f, 0, 0);
GL11.glRotatef(sceneroty, 0, 1.0f, 0);
I thought a good solution would be to change them to this:
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glRotatef(lookupdown, 1.0f, 0, 0);
GL11.glRotatef(sceneroty, 0, 1.0f, 0);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
However this causes the level to look normal at first but if I try to do anything that involves rotating it makes the level start spinning out of control.
Any idea how I can conquer this one? Thanks a lot I do appreciate the help.
Based on what I've read with openGL. That is what the distinction between MODELVIEW and PROJECTION matrix modes is for.
Lesson 10 seems to rotate the entire world as one big model with MODELVIEW. So what i'm confused about is if I was to attempt to add a quad to the middle of the level and then rotate it with glRotatef that would rotate not only the quad but all of the walls, floors and everything else that is part of the scene. Not just the quad like I would like to try and do.
Since the heading and looking angle appear to be taken care of only by the below two lines:
GL11.glRotatef(lookupdown, 1.0f, 0, 0);
GL11.glRotatef(sceneroty, 0, 1.0f, 0);
I thought a good solution would be to change them to this:
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glRotatef(lookupdown, 1.0f, 0, 0);
GL11.glRotatef(sceneroty, 0, 1.0f, 0);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
However this causes the level to look normal at first but if I try to do anything that involves rotating it makes the level start spinning out of control.
Any idea how I can conquer this one? Thanks a lot I do appreciate the help.