Guest User

Untitled

a guest
Jul 17th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. protected override void Draw(GameTime gameTime)
  2. {
  3. graphics.GraphicsDevice.Clear(Color.Black);
  4. graphics.GraphicsDevice.VertexDeclaration = vertexDeclaration;
  5. graphicsDevice.RenderState.FillMode = FillMode.WireFrame;
  6. // Update our camera
  7. UpdateCameraThirdPerson();
  8.  
  9. basicEffect.Begin();
  10. basicEffect.Projection = proj;
  11. basicEffect.View = view;
  12.  
  13. basicEffect.Alpha = 1.0f;
  14. basicEffect.DiffuseColor = new Vector3(.75f, .75f, .75f);
  15. basicEffect.SpecularColor = new Vector3(0.25f, 0.25f, 0.25f);
  16. basicEffect.SpecularPower = 5.0f;
  17.  
  18. basicEffect.AmbientLightColor = new Vector3(0.75f, 0.75f, 0.75f);
  19. basicEffect.DirectionalLight0.Enabled = true;
  20. basicEffect.DirectionalLight0.DiffuseColor = Vector3.One;
  21. basicEffect.DirectionalLight0.Direction = Vector3.Normalize(new Vector3(1.0f, -1.0f, -1.0f));
  22. basicEffect.DirectionalLight0.SpecularColor = Vector3.One;
  23.  
  24. basicEffect.DirectionalLight1.Enabled = true;
  25. basicEffect.DirectionalLight1.DiffuseColor = new Vector3(0.8f, 0.8f, 0.8f);
  26. basicEffect.DirectionalLight1.Direction = Vector3.Normalize(new Vector3(-1.0f, -1.0f, 1.0f));
  27.  
  28. basicEffect.LightingEnabled = true;
  29.  
  30. foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
  31. {
  32. pass.Begin();
  33. graphics.GraphicsDevice.RenderState.FillMode = FillMode.WireFrame;
  34. Render();
  35. pass.End();
  36. }
  37. basicEffect.End();
  38. Matrix World = Matrix.CreateRotationY(avatarYaw) * Matrix.CreateTranslation(avatarPosition);
  39. DrawCameraState();
  40. spriteBatch.Begin();
  41. spriteBatch.DrawString(spriteFont, "Esc: Opens the console.", new Vector2(10, graphics.GraphicsDevice.Viewport.Height - 30), Color.White);
  42. spriteBatch.End();
  43. base.Draw(gameTime);
  44. }
Add Comment
Please, Sign In to add comment