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.

Newcomers AppGameKit Corner / CAmera look at center of the screen (or an object in the center of the screen)

Author
Message
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 25th Jun 2016 10:33 Edited at: 25th Jun 2016 17:04
Hi

i would like to "lock" my camera in the center of the screen with SetCameraLookAt().

I have made a little code which works, but I have a little difference for the center of the the view between move and rotate :


Do you knwo How I can fixe that ?

Thanks
AGK2 tier1 - http://www.dracaena-studio.com
29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 25th Jun 2016 13:16
I'm not entirely sure how to fix your code but this is how I might do a 3d scene pan and rotate:



Is this the kind of effect that you wanted?
Hover Car Race Challenge! - available now on Google Play
Invaders of the 29th Dimension - available now on Google Play
Find me on indieDB
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 25th Jun 2016 18:29
Hi 29games :
thanks again, I have modified a little your code to work like I would (the zoom is made with the mouse wheel for exemple ^^). It works fine, thanks a lot.
AGK2 tier1 - http://www.dracaena-studio.com
Mark532011
7
Years of Service
User Offline
Joined: 27th Jun 2016
Playing: X-Com, WOW-Legion
Posted: 9th Jul 2016 00:16
29 Games: That is really creative! rather than trying to calculate angles and distances, just create an invisible entity and use the built-in functions. I learned a ton just from reading your example.
Mark
Mark532011
7
Years of Service
User Offline
Joined: 27th Jun 2016
Playing: X-Com, WOW-Legion
Posted: 15th Jul 2016 15:35
Could this be modified, rather than using "SetCameraPosition", could you use "SetCameraLookAt"? is that what it is for?
Mark

Login to post a reply

Server time is: 2024-03-29 06:31:56
Your offset time is: 2024-03-29 06:31:56