Quick(hopefully) question.
Posted: Fri Aug 07, 2009 9:57 pm
Is there the concept of a camera in OpenGL? A camera as in a specific point in space, looking in a direction, and that is what is rendered, basically like an eye. I have made games in SDL, in which there is no concept of a camera(I think) and I had to make all my images display on a specific offset, and display only what would be visible in the view of my screen. But that would be very hard/confusing to do in OpenGL ES for the iPhone, so... I was wondering, how to go about doing this.
My game is 2D, so the only things I'd be changing would be the X,Y positions. No rotation needed.
My guess is it has something to do with calling:
glOrthof(x,y,w,h);
glViewport(0,0,320,480);
but that is just a guess. Also: what exactly do orthof and viewport do? Im pretty sure that orthof and frustmf define the chunk of space to be rendered, and I really have no idea what viewport does... didn't we already say what to render? Maybe it is telling it which ways to stretch/resize if necessary...
Anyway, after that long rant... please answer, because I am at a standstill in development for now until this is answered. Thanks, seeya.
My game is 2D, so the only things I'd be changing would be the X,Y positions. No rotation needed.
My guess is it has something to do with calling:
glOrthof(x,y,w,h);
glViewport(0,0,320,480);
but that is just a guess. Also: what exactly do orthof and viewport do? Im pretty sure that orthof and frustmf define the chunk of space to be rendered, and I really have no idea what viewport does... didn't we already say what to render? Maybe it is telling it which ways to stretch/resize if necessary...
Anyway, after that long rant... please answer, because I am at a standstill in development for now until this is answered. Thanks, seeya.