Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Camera3rdPerson
- {
- public Matrix view;
- public Matrix proj;
- public Camera3rdPerson()
- {
- proj = Matrix.CreatePerspectiveFieldOfView(0.78f, 1.777f, 1f, 10000f);
- }
- public void Update(Matrix objectToFollow)
- {
- Vector3 camPosition = objectToFollow.Translation +
- (objectToFollow.Backward * 200f) +
- (objectToFollow.Up * 150f) +
- (objectToFollow.Left * 20f);
- Vector3 camTarget = objectToFollow.Translation +
- (objectToFollow.Up * 75);
- view = Matrix.CreateLookAt(camPosition, camTarget, Vector3.Up);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement