Platform SDK: DirectX

Step 4.1: Update the Scene

[C++]

This section pertains only to application development in Visual Basic. See Direct3D Immediate Mode C/C++ Tutorials.

[Visual Basic]

Before a scene is rendered it must be updated. Immediately after RenderScene returns, FrameMove is called (another application-defined subroutine). FrameMove simply updates the world matrix that Direct3D applies to the geometry of the model. The application reflects a rotation around the y-axis based on an internal count value, passed to FrameMove in the stepValue parameter. Since the rotation is applied once per frame, the end result looks like the model is rotating in place.

Private Sub FrameMove(stepVal As Single)
    Dim matSpinY As D3DMATRIX
 
    Call g_dx.RotateYMatrix(matSpinY, stepVal)
    Call g_d3dDevice.SetTransform(D3DTRANSFORMSTATE_WORLD, matSpinY)
End Sub

In the real-world, of course, your applications will do much more than apply a single rotation on a single model. (For more information on rotation matrices, see Rotation in the 3-D Transformations section.)

After you update the model's geometry in the scene, you can render it to the render target surface, as the Triangle tutorial application illustrates in Step 4.2: Render the Scene.