i have no idea whats wrong....

Started by
6 comments, last by Syrillix 21 years, 8 months ago
ive been working through the opengl tutorials at gametutorials.com and everything was going fine (except for strange windows behaviour) although now im going through the camera tuts and trying to move the camera around but all its doing is disapearing off the screen... Get busy livin'' or get busy dyin''... - Shawshank Redemption
Get busy livin' or get busy dyin'... - Shawshank RedemptionIf a man is talking in the forest, and no woman is around to hear him, is he still wrong? - UnknownFulcrum
Advertisement
you need to be a lot more specific about what the problems are that you''re having. I''ve worked through all those tutorials so I might be able to help you if you give details about what is going wrong.
make sure youre callin glLoadIdentity() in whatever routine youre doing transforms in.
ok now ive sorted out some of the problems.. but when i press the left or right keys the camera goes crazy and starts going around and around and also moving up abit each time. i cant figure it out...
digitec, where exactly do i call glLoadIdentity() right before i start drawing or somewhere else?

Get busy livin'' or get busy dyin''... - Shawshank Redemption
Get busy livin' or get busy dyin'... - Shawshank RedemptionIf a man is talking in the forest, and no woman is around to hear him, is he still wrong? - UnknownFulcrum
if youre using gluLookat, glRotate*, glTranslate*, you need a call to glLoadIdentity() before those, it ensures that the modelview matrix is in the same state every time you draw, post your code
I have the same problem and here is the solution:Make sure that you include the line SetCursorPos) each time you make the camera calculations.



The pain is coming...this sommer!!!
thanks for your all your help, My main concern now is getting the frames per second function working from the tutorials
ok, heres a run down for my code

class window
{
//all the windows stuff
//its all public
}

class OGL: public Window
{
//ogl stuff
void RenderScene()
void FrameRate()
}

void OGL::FrameRate()
{
static float FramesPerSec = 0.0;
static float LastTime = 0.0;

static char strFrameRate[50] = {0};

//gets the current time in seconds
float CurrentTime = GetTickCount() * 0.001;

++FramesPerSec;

if((CurrentTime-LastTime) <1.0)
{
LastTime = CurrentTime;
sprintf(strFrameRate,"CurrentFramesPerSec: ",int(FramesPerSec));
SetWindowText(m_hWnd,strFrameRate);

FramesPerSec = 0;
}
}

void OGL::RenderScene
{
//....
....
FrameRate();
}

For some strange (annoying) reason SetWindowText() wont display to the title bar... i cant figure it out. the code is exactly how it is in the tutorial...

Get busy livin'' or get busy dyin''... - Shawshank Redemption
Get busy livin' or get busy dyin'... - Shawshank RedemptionIf a man is talking in the forest, and no woman is around to hear him, is he still wrong? - UnknownFulcrum
actually scratch that last question. god im an eediot!!!!!!!
scratching my head over this problem for an hour an it was a simple logic error, well that and i forgot %d in the string.. oh well that''ll learn me..

Get busy livin'' or get busy dyin''... - Shawshank Redemption
Get busy livin' or get busy dyin'... - Shawshank RedemptionIf a man is talking in the forest, and no woman is around to hear him, is he still wrong? - UnknownFulcrum

This topic is closed to new replies.

Advertisement