PDA

View Full Version : Few quick questions



PaulR
11-29-2011, 01:20 PM
I've got what I can call the beginnings of the 3D game in this java binding of OpenGL LWJGL. I've made a simple scene with a few items in it, one of which is the character. How it works now is that the camera is static and stays in the same place while I press keys, which changes the character's x and z coordinates and then re-renders the screen. I'm not really sure how I'd go about making the camera move with the actor. If I'm completely going down the wrong path I'd appreciate any help or guidance you could offer.

EDIT: also, do you also know how to stop thing beyond a certain perimeter from rendering. I know it's done through a clipping volume. Have I already done this? :x Because it doesn't seem to stop after the cut off point.

Thanks in advance!

PaulR
11-29-2011, 01:21 PM
I've included the source just so you can see what I've done so far. :p

BionicBytes
11-29-2011, 01:53 PM
: also, do you also know how to stop thing beyond a certain perimeter from rendering. I know it's done through a clipping volume. Have I already done this? :x Because it doesn't seem to stop after the cut off point.
Try enabling glScissorTest. Might be what you need.

PaulR
11-29-2011, 02:04 PM
I'll have a read up on that function, thanks! Do you know how I can move the camera? Also, whether I should be. :p

BionicBytes
11-29-2011, 02:37 PM
By building a modelview matrix. Google the functionality of gluLookat and build some matricies like that function.

PaulR
11-29-2011, 04:14 PM
I've heard about gluLookAt and forgive me for my ignorance, but would I be able to achieve the same or similar effects by manipulating the scene using glRotate, glTranslate, etc?