/// <summary> /// Invoked when our second control is ready to render. /// </summary> private void OnGraphicsControlDraw(object sender, DrawEventArgs e) { e.GraphicsDevice.Clear(Color.CornflowerBlue); var position = ((SceneViewModel) DataContext).Position; _basicEffect.World = Matrix.RotationYawPitchRoll(_yaw, _pitch, 0f) * Matrix.Translation(position); _basicEffect.Projection = Matrix.PerspectiveFovLH((float) Math.PI / 4.0f, (float) e.GraphicsDevice.BackBuffer.Width / e.GraphicsDevice.BackBuffer.Height, 0.1f, 100.0f); _geometricPrimitives[_primitiveIndex].Draw(_basicEffect); }
protected virtual void RaiseDraw(DrawEventArgs args) { var handler = Draw; if (handler != null) handler(this, args); }