Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TMainForm.SetCameraDistance(Distance: Single);
- begin
- fCameraDistance := Distance;
- // To be at 45 degrees to the map we'll need to offset two coords by this much:
- var Offset := Distance / Sqrt(2);
- // And we can work out how high we need to be at this distance to be looking at 0, 0, 0
- var Height := Distance * Tan(DegToRad(30));
- // Rotate and move camera so it is looking 45 degrees around and 30 degrees down
- // and set the view angle to a very small value to remove perspective
- Camera.RotationAngle.Point := TPoint3D.Create(-30, 45, 0);
- Camera.Position.Point := TPoint3D.Create(-Offset, -Height, -Offset);
- Camera.AngleOfView := 1;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement