Camera Moving and Rotation

Problems with Canvas, OpenGL, etc...

Camera Moving and Rotation

Postby SMASH1337 » Mon May 16, 2011 9:15 pm

So I'm trying to wrap my head around how I would get a camera to move and rotate in OpenGL. I understand that there's no initial camera and that it's static, but I have to assume that there's been some sort of progress on this, as moving everything in a scene to simulate camera movement seems excessive and like a waste of time.

I've been googling for hours trying to find something, ideally to make a camera class that would be able to be manipulated easily from my main GLSurfaceView. Any help would be greatly appreciated.
Posts: 9
Joined: Wed Mar 16, 2011 1:03 am


Re: Camera Moving and Rotation

Postby » Tue May 17, 2011 11:57 pm

Camera's effectively boil down to a transformation which you apply to your scene, so effectively you are 'moving the whole scene', but you shouldn't be applying the transformations by hand.

Are you using fixed-function or a programmable pipeline?

For programmable, your mvp matrix is your camera. Simply store that matrix in your camera, and have its motion modify that matrix.

I forgot the exact syntax for applying matrix transformations to your geometry in fixed. Same deal though, store your camera state in a matrix and come render type, apply that matrix to your geometry.
User avatar
Posts: 41
Joined: Tue Mar 02, 2010 8:33 pm


Return to Android 2D/3D Graphics - OpenGL Problems

Who is online

Users browsing this forum: No registered users and 2 guests