So basically, what I'm trying to accomplish is a camera that automatically pans/moves forward slowly, as seen in some platforming games, or top-down helicopter shooters (what I'm aiming at now).
So far I've come up with the following function:
Code: Select all
void render::Camera(float sY, float eY)
{
float cY = sY;
float LastFrame = cY;
float CurrentFrame = cY+1;
if(LastFrame == CurrentFrame)
CurrentFrame = CurrentFrame + 1;
if(LastFrame > CurrentFrame)
CurrentFrame = LastFrame;
if(CurrentFrame <= eY)
{
LastFrame = LastFrame + 1;
rScene->addCameraSceneNode(0, vector3df(0, CurrentFrame, 0), vector3df(0, CurrentFrame, 10));
}
}
cY is equal to Camera Y(Currnet Y Position), sY is Start Y (where I start panning), and eY is End Y (when panning should stop). Unfortunatly tho this code just displays the camera at the start Y, and does not move at all. I thought maybe it was because it wasnt being consitently being updated, but running while(CurrentFrame <= eY) instead of if(CurrentFrame <= eY), just presents me with a white screen, not loading anything. Any and all help is appreciated, thanks in advance!