Guest User

Untitled

a guest
Jun 14th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. // Draw the model. A model can have multiple meshes, so loop.
  2. foreach (ModelMesh mesh in myModel.Meshes)
  3. {
  4. // This is where the mesh orientation is set, as well as our camera and projection.
  5. foreach (BasicEffect effect in mesh.Effects)
  6. {
  7. effect.EnableDefaultLighting();
  8. effect.World = transforms[mesh.ParentBone.Index]
  9. * Matrix.CreateRotationY(modelRotation)
  10. * Matrix.CreateRotationX(modelRotation)
  11. * Matrix.CreateTranslation(modelPosition);
  12. effect.View = Matrix.CreateLookAt(cameraPosition, Vector3.Zero, Vector3.Up);
  13. effect.Projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45.0f),
  14. aspectRatio, 1.0f, 10000.0f);
  15. }
  16. // Draw the mesh, using the effects set above.
  17. mesh.Draw();
  18. }
Add Comment
Please, Sign In to add comment