MCPcopy Create free account
hub / github.com/assimp/assimp / RenderStereoView

Method RenderStereoView

tools/assimp_view/Display.cpp:1516–1549  ·  view source on GitHub ↗

------------------------------------------------------------------------------- Do the actual rendering pass for the stereo view

Source from the content-addressed store, hash-verified

1514//-------------------------------------------------------------------------------
1515// Do the actual rendering pass for the stereo view
1516int CDisplay::RenderStereoView(const aiMatrix4x4& m)
1517{
1518 // and rerender the scene
1519 if (nullptr != g_pcAsset && nullptr != g_pcAsset->pcScene->mRootNode)
1520 {
1521 // enable the BLUE, GREEN and ALPHA channels
1522 g_piDevice->SetRenderState(D3DRS_COLORWRITEENABLE,
1523 D3DCOLORWRITEENABLE_GREEN |
1524 D3DCOLORWRITEENABLE_ALPHA |
1525 D3DCOLORWRITEENABLE_BLUE);
1526
1527 // clear the z-buffer
1528 g_piDevice->Clear(0,nullptr,D3DCLEAR_ZBUFFER,0,1.0f,0);
1529
1530 // move the camera a little bit to the right
1531 g_sCamera.vPos += g_sCamera.vRight * 0.06f;
1532
1533 RenderNode(g_pcAsset->pcScene->mRootNode,m,false);
1534 g_piDevice->SetRenderState(D3DRS_ZWRITEENABLE,FALSE);
1535 RenderNode(g_pcAsset->pcScene->mRootNode,m,true);
1536 g_piDevice->SetRenderState(D3DRS_ZWRITEENABLE,TRUE);
1537
1538 // (move back to the original position)
1539 g_sCamera.vPos -= g_sCamera.vRight * 0.03f;
1540
1541 // re-enable all channels
1542 g_piDevice->SetRenderState(D3DRS_COLORWRITEENABLE,
1543 D3DCOLORWRITEENABLE_RED |
1544 D3DCOLORWRITEENABLE_GREEN |
1545 D3DCOLORWRITEENABLE_ALPHA |
1546 D3DCOLORWRITEENABLE_BLUE);
1547 }
1548 return 1;
1549}
1550//-------------------------------------------------------------------------------
1551// Process input for the texture view
1552int CDisplay::HandleInputTextureView()

Callers

nothing calls this directly

Calls 1

ClearMethod · 0.45

Tested by

no test coverage detected