Advertisement
madmenyo

Add on to camera rotation snippet

Apr 22nd, 2011
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.43 KB | None | 0 0
  1. //declare this variable on top
  2. Vector3 direction;
  3.  
  4. //Add this in an input statement inside the update method, like a call for the spacebar.
  5.  
  6. //first line calculates the direction from the current camera position and the model position
  7. direction = myModelPosition - finalCameraPosition;
  8. //normalize that vector.
  9. direction.Normalize();
  10.  
  11. //Then add this outside any statements in the Update method.
  12. myModelPosition += direction;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement