当前位置: 首页>>代码示例>>C++>>正文


C++ CModelViewerCamera::FrameMove方法代码示例

本文整理汇总了C++中CModelViewerCamera::FrameMove方法的典型用法代码示例。如果您正苦于以下问题:C++ CModelViewerCamera::FrameMove方法的具体用法?C++ CModelViewerCamera::FrameMove怎么用?C++ CModelViewerCamera::FrameMove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CModelViewerCamera的用法示例。


在下文中一共展示了CModelViewerCamera::FrameMove方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnFrameMove

void CALLBACK OnFrameMove(_In_ double fTime, _In_ float fElapsedTime, _In_opt_ void* pUserContext)
{
	static float rot = 0.0f;
	rot += fElapsedTime;
	XMMATRIX mscale = XMMatrixScaling(1.0f, 1.0f, 1.0f);
	XMMATRIX mrot	= XMMatrixRotationRollPitchYaw(0.0f, 0.0f, rot);
	XMMATRIX mtrans = XMMatrixTranslation(20.0f, 50.0f, 0.0f);

	// gmesh 의 월드 매트릭스 -> XMMATRIX
	XMMATRIX mParent = XMLoadFloat4x4(&g_mesh->getWorld());

	g_matLight = (mscale * mtrans * mrot) * mParent;
	
	// 조명 메시 연결
	XMFLOAT4X4 mlit = XMFLOAT4X4();
	XMStoreFloat4x4(&mlit, g_matLight);
	g_meshLight->setWorld(mlit);


	g_camera.FrameMove(fElapsedTime);




}
开发者ID:contacoonta,项目名称:sgap-direct3d,代码行数:25,代码来源:DXUTMain.cpp

示例2: OnFrameMove

void CALLBACK OnFrameMove(double fTime, float fElapsedTime, void* pUserContext)
{
	g_input->Update();
	if (g_input->isKeyPressed(DIK_ESCAPE))
		DXUTShutdown();

	/*if (g_input->isKeyPressed(DIK_F1))
		DXUTToggleFullScreen();*/

	g_camera.FrameMove(fElapsedTime);
}
开发者ID:contacoonta,项目名称:sgap-direct3d,代码行数:11,代码来源:DXUTMain.cpp

示例3: OnFrameMove

//--------------------------------------------------------------------------------------
// Handle updates to the scene.  This is called regardless of which D3D API is used
//--------------------------------------------------------------------------------------
void CALLBACK OnFrameMove( double fTime, float fElapsedTime, void* pUserContext )
{
    // Update position of collision objects
    Animate( fTime );

    // Compute collisions
    Collide();

    // Update the camera's position based on user input 
    g_Camera.FrameMove( fElapsedTime );
}
开发者ID:AndreAhmed,项目名称:directx-sdk-samples,代码行数:14,代码来源:Collision.cpp

示例4: OnFrameMove

//--------------------------------------------------------------------------------------
// Handle updates to the scene.  This is called regardless of which D3D API is used
//--------------------------------------------------------------------------------------
void CALLBACK OnFrameMove( double fTime, float fElapsedTime, void* pUserContext )
{
    // Update the camera's position based on user input 
    g_Camera.FrameMove( fElapsedTime );

    if( g_bSpinning )
        D3DXMatrixRotationY( &g_World, 60.0f * DEG2RAD((float)fTime) );
    else
        D3DXMatrixRotationY( &g_World, DEG2RAD( 180.0f ) );

    D3DXMATRIX mRot;
    D3DXMatrixRotationX( &mRot, DEG2RAD( -90.0f ) );
    g_World = mRot * g_World;
}
开发者ID:KNeal,项目名称:Oculus,代码行数:17,代码来源:Tutorial13.cpp

示例5: OnFrameMove

//--------------------------------------------------------------------------------------
// Handle updates to the scene.  This is called regardless of which D3D API is used
//--------------------------------------------------------------------------------------
void CALLBACK OnFrameMove(double fTime, float fElapsedTime, void* pUserContext)
{
    SceneMesh *pSceneMesh = g_Scenes[g_CurrentSceneId].pMesh;
    g_UseOrbitalCamera = pSceneMesh && pSceneMesh->UseOrbitalCamera();

    if (g_UseOrbitalCamera)
    {
        g_OrbitalCamera.FrameMove(fElapsedTime);
    }
    else
    {
        g_FirstPersonCamera.FrameMove(fElapsedTime);
    }
}
开发者ID:151706061,项目名称:D3DSamples,代码行数:17,代码来源:DeinterleavedTexturing.cpp

示例6: OnFrameMove

//--------------------------------------------------------------------------------------
// This callback function will be called once at the beginning of every frame. This is the
// best location for your application to handle updates to the scene, but is not 
// intended to contain actual rendering calls, which should instead be placed in the 
// OnFrameRender callback.  
//--------------------------------------------------------------------------------------
void CALLBACK OnFrameMove( double fTime, float fElapsedTime, void* pUserContext )
{
    // Update the camera's position based on user input 
    g_Camera.FrameMove( fElapsedTime );

    UpdateLightingEnvironment();

    if( g_pAnimController != NULL )
    {
        g_pAnimController->SetTrackSpeed( 0, g_SampleUI.GetSlider( IDC_ANIMATION_SPEED )->GetValue() / 1000.0f );
        g_pAnimController->AdvanceTime( fElapsedTime, NULL );
    }

    UpdateFrameMatrices( g_pFrameRoot, g_Camera.GetWorldMatrix() );
}
开发者ID:KNeal,项目名称:Oculus,代码行数:21,代码来源:LocalDeformablePRT.cpp

示例7: OnFrameMove

//--------------------------------------------------------------------------------------
// Handle updates to the scene.
//--------------------------------------------------------------------------------------
void CALLBACK OnFrameMove( double fTime, float fElapsedTime, void* pUserContext )
{
    // Update the camera's position based on user input 
    g_Camera.FrameMove( fElapsedTime );

    if( g_bSpinning )
    {
        g_World = XMMatrixRotationY( 60.0f * XMConvertToRadians((float)fTime) );
    }
    else
    {
        g_World = XMMatrixRotationY( XMConvertToRadians( 180.f ) );
    }

    XMMATRIX mRot = XMMatrixRotationX( XMConvertToRadians( -90.0f ) );
    g_World = mRot * g_World;
}
开发者ID:AndreAhmed,项目名称:directx-sdk-samples,代码行数:20,代码来源:Tutorial11.cpp

示例8: OnFrameMove

//--------------------------------------------------------------------------------------
// Handle updates to the scene.  This is called regardless of which D3D API is used
//--------------------------------------------------------------------------------------
void CALLBACK OnFrameMove( double fTime, float fElapsedTime, void* pUserContext )
{
    D3DXMATRIXA16 mWorld;
    D3DXMATRIXA16 mView;
    D3DXMATRIXA16 mProj;
    D3DXMATRIXA16 mWorldViewProjection;

    // Update the camera's position based on user input 
    g_Camera.FrameMove( fElapsedTime );

    // Get the projection & view matrix from the camera class
    mWorld = g_mCenterWorld * *g_Camera.GetWorldMatrix();
    mProj = *g_Camera.GetProjMatrix();
    mView = *g_Camera.GetViewMatrix();

    mWorldViewProjection = mWorld * mView * mProj;

    // Update the effect's variables 
    g_pEffect->SetMatrix( g_hWorldViewProjection, &mWorldViewProjection );
    g_pEffect->SetMatrix( g_hWorld, &mWorld );
    g_pEffect->SetFloat( g_hTime, ( float )fTime );
}
开发者ID:KNeal,项目名称:Oculus,代码行数:25,代码来源:CompiledEffect.cpp

示例9: OnFrameMove

//--------------------------------------------------------------------------------------
// Handle updates to the scene.  This is called regardless of which D3D API is used
//--------------------------------------------------------------------------------------
void CALLBACK OnFrameMove( double fTime, float fElapsedTime, void* pUserContext )
{
    // Update the camera's position based on user input 
    g_Camera.FrameMove( fElapsedTime );
}
开发者ID:AndreAhmed,项目名称:directx-sdk-samples,代码行数:8,代码来源:DynamicShaderLinkageFX11.cpp

示例10: OnFrameMove

//--------------------------------------------------------------------------------------
// Handle updates to the scene.  This is called regardless of which D3D API is used
//--------------------------------------------------------------------------------------
void CALLBACK OnFrameMove(double fTime, float fElapsedTime, void* pUserContext)
{
	g_Camera.FrameMove(fElapsedTime);
}
开发者ID:maleiwhat,项目名称:vectorizing-project,代码行数:7,代码来源:VolSurfaces10.cpp

示例11: OnFrameMove

//--------------------------------------------------------------------------------------
// Handle updates to the scene.
//--------------------------------------------------------------------------------------
void CALLBACK OnFrameMove( double fTime, float fElapsedTime, void* pUserContext )
{
	g_camera.FrameMove(fElapsedTime);
	g_mesh.Update();
}
开发者ID:contacoonta,项目名称:sgap-direct3d,代码行数:8,代码来源:DXUTMain.cpp


注:本文中的CModelViewerCamera::FrameMove方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。