Hi,
I've been studying the Binary Moon tutorial (Limit Rush) and I want to change something which should be easy. I want to change the camera angle, so it displays the player vehicle in a top-down view instead of chasing it from behind.
I've been struggling for hours, and now I'm completely out of ideas of what to do. Boy, I had no idea this would be so tough for me.
Can anyone please help me out?
You'll find the code for the camera below. It follows an object id from a certain angle. I want to position it far above the object, looking down on it (top-down view).
function chase_cam(id)
`work out the angle of the object being chased
yAng#=wrapvalue(object angle y(id)+180)
`grab the cameras current position
xPos#=object position x(id)
yPos#=object position y(id)
zPos#=object position z(id)
`other variables
camDist=15
camHeight=3
`work out new position
xCamPos#=newxvalue(xPos#,yAng#,camDist)
zCamPos#=newZvalue(zPos#,yAng#,camDist)
`work out camera height
yCamPos#=get ground height(1,xCamPos#,zCamPos#)+camHeight
if yCamPos#<yPos#+camHeight then yCamPos#=yPos#+camHeight
`update camera position
position camera xCamPos#,yCamPos#,zCamPos#
point camera xPos#,yPos#+camHeight,zPos#
endfunction
Thanks.
--Erwin