Game Programming Algorithms and Techniques: A Platform-Agnostic Approach (Jason Arnold's Library) by Sanjay Madhav

Game Programming Algorithms and Techniques: A Platform-Agnostic Approach (Jason Arnold's Library) by Sanjay Madhav

Author:Sanjay Madhav
Language: eng
Format: epub
Publisher: Addison-Wesley Professional
Published: 2014-03-24T16:00:00+00:00


// Initializes all the camera parameters

function Initialize(GameObject myPlayer, Vector3 myVerticalOffset,

Vector3 myTargetOffset)

player = myPlayer

verticalOffset = myVerticalOffset

targetOffset = myTargetOffset

// Initially, there's no extra yaw or pitch

totalYaw = 0

totalPitch = 0

// Calculate camera matrix

Vector3 eye = player.position + verticalOffset

Vector3 target = eye + targetOffset

// For y-up world

Vector3 up = Vector3(0, 1, 0)

cameraMatrix = CreateLookAt(eye, target, up)

end



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.