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 / 3D zoom with multitouch

Author
Message
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 9th Apr 2023 14:48
Hi

I would like to have a zoom with multitouch, in a 3D game (so it use a camera).

Do you know how I could do that ?
I have tried but for the moment, i haven't found how to do ^^

my code bugged :
AGK2 tier1 - http://www.dracaena-studio.com
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 9th Apr 2023 22:12
There is an example project with the AppGameKit install in the input folder called multitouch
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 10th Apr 2023 11:01
Hi Blinok

Thanks, but it's an example with sprite, and for the moment, I haven't understand how to use it to zoom my camera in 3D ^^ (on mobile)
AGK2 tier1 - http://www.dracaena-studio.com
Zappo
Valued Member
19
Years of Service
User Offline
Joined: 27th Oct 2004
Location: In the post
Posted: 10th Apr 2023 16:04
Hi Blendman.
The command you are probably looking for is SetCameraFOV. This will adjust the field of view for the camera. By adjusting that from the default value of 70, you can make the camera appear to zoom in or out.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 11th Apr 2023 00:04
It seems to work ok for me except you can zoom past the view pane. Can you explain or show how it is not working?
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 11th Apr 2023 08:22
Hi

Thank you for your answer

Quote: "Can you explain or show how it is not working?"

in the first code, we can zoom in or out but not as we want. The zoom don't stop even if we don't move our fingers, and it's impossible to zoom like we want (zoom in or out, it's a kind of random ^^)..

Another test, which seems to work better : (I have found this code on the agk example commands, and change it to work with 3D),
- we can zoom in/out and only with two fingers
- if we zoom in, the camera zoom in
- if we zoom out, the camera zoom out

But I have two bugs to fixes (I don't know how for the moment) :
- sometimes, the view is "duplicated" (a little "shaked" )
- I would like to knwo how to not change the position of the box "N1" (the camera has the same position) when I begin to do a multitouch, because each time we start to change the zoom (with the distance of two finders different), the camera keep not its precedent place but is placed immediatly at the place of the zoom factor.

AGK2 tier1 - http://www.dracaena-studio.com

Login to post a reply

Server time is: 2024-04-25 00:11:20
Your offset time is: 2024-04-25 00:11:20