
CHAPTER 1 ■ GETTING STARTED WITH XNA 3.0
18
billboardGC.camForward = quatCam.Forward;
billboardGC.camPosition = quatCam.Position;
billboardGC.viewMatrix = quatCam.ViewMatrix;
billboardGC.projectionMatrix = quatCam.ProjectionMatrix;
base.Update(gameTime);
}
The Draw method of your main Gameclassisevensimpler:justclearthescreenbefore
calling the Draw method of all the components:
protected override void Draw(GameTime gameTime)
{
device.Clear(ClearOptions.Target | ClearOptions.DepthBuffer,
➥
Color.CornflowerBlue, 1, 0);
base.Draw(gameTime);
}
The last line will cause the Draw method of the billboarding component to be called,
rendering the ...