Skip to main content
gamedev.net
🔒 Locked

CFirstPersonCamera

Started by Pushapjit Dec 12, 2005 at 5:44 AM 1 replies 1.8k views
Original Post
Pushapjit
Pushapjit
I am using DirectX9a. I am Developing my code with CMyD3DApplication class. Now, I want to put camera interactivity to my model. I got CFirstPersonCamera class from DirectX9C SDK. there is one problem that in CFirstPersonCamera class

VOID CFirstPersonCamera::FrameMove( FLOAT fElapsedTime )
{
    if( DXUTGetGlobalTimer()->IsStopped() )
        fElapsedTime = 1.0f / DXUTGetFPS();
 ......
 ......
}
 

I am calling the above function from :-
HRESULT CMyD3DApplication::FrameMove()
{
    
....
....
// Simple static scene, so just update the camera 
     m_Camera.FrameMove ( m_fElapsedTime);
.....
.....
}

Can I run the code without using DXUTGetFPS() function.
acid2
acid2
Hi Pushapjit,

Sure, at a guess just remove that function call. Failing that, try a value like 0.001f. That function is inserted there for delta timing, which means that you will (well, should) always see similar framerates, that is the location of objects, regardless of what the actuall framework is.

Hth,
Pushapjit
Pushapjit
thanks
in DirectX9c CfirstPersonCamera & CBaseCamera is defined in DXUTmisc.h DxUTmisc.cpp files.

in DxUTmisc.cpp

#include "dxstdafx.h"

is defined. Do I also need to include the above file with my CMyD3DApplication Class?
I am using DirectX9a framework.

I made Camera.h & Camera.cpp files which contains my CFirstPersonCamera code.


2) when I render my code my 3Dmodel appears just for small time and then disappears, I can see it again only by changing the window size again and again.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.