Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Orbit a camera around a point?

Author
Message
Fluorescent
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 1st Aug 2005
Location: Stockholm, Sweden
Posted: 20th Aug 2017 10:12
I'm exploring the seedy underbelly of 3d. And I'm trying to get a camera to orbit a point. This is what I've got so far. The numbers are for percentage system so with virtual resolution it will be very fine movements.


It works pretty well to start with, but get's kind of weird when you reach the opposite side of the point. So does anyone happen to have a suggestion on how to get a smooth movement all the way around?

MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 20th Aug 2017 11:23 Edited at: 20th Aug 2017 11:23
maybe you can (not tested but should work) :

- set the position of the camera the same as the target point
- set the rotation of the camera with the wanted angle
- MoveCameraLocalZ(1, -Distance)

(+ potentially call the SetCameraLookAt Target command at the end if you modify the Y of the camera)

?

Be aware about greater the distance will be, more the angle must be precise
--------------------------------
Join us on dedicated AppGameKit WeeKChat :
https://week.chat/room/AppGameKit

Login to post a reply

Server time is: 2024-11-24 09:26:28
Your offset time is: 2024-11-24 09:26:28