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 / Camera appears zoomed in on an iPhone

Author
Message
Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 3rd Nov 2015 04:25
I'm still getting the hang of using AGK's awesome 3D capabilities, and have been getting my next game's prototype completed. One thing I've noticed is that when I export my app for iPhone and play it there, the camera appears more zoomed in. On my Mac there's room on the top and bottom of my 3D objects that I've placed in my scene, but on the iPhone, it's chopping some of the items off on the top and bottom. This might be a stupid question and please excuse my ignorance, but is there a way to get an exact interpretation of my scene from resolution to resolution, even if it would mean stretching or shrinking?

If not, how do you guys set your camera up to not pull out too far on a computer and not zoom in too close on a smaller screen? Is it really just a matter of checking the screen width and height beforehand? It seems like there must be a way to have the same representation on my computer screen as on my phone, especially if I use the same aspect ratio.

Thanks
Senior Software Engineer - RotoGrinders
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 3rd Nov 2015 10:14
The answer may be something like this:



The thread I got this from is here:

link

Let me know if this does not work, I have a Unity project somewhere that solved the same issue, I will dig it out. If I remember it was more code than that example above and must have handled more situations or something It was a while ago!
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 3rd Nov 2015 15:47
It depends very much on how you are setting up your screen, what virtual resolution are you using, are you using SetScissor(0,0,0,0), are you changing the FOV, etc. If you post a small example I might be able to tweak it to do what you want.
Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 4th Nov 2015 01:03 Edited at: 4th Nov 2015 01:06
@Matty H - I'll try that option, thanks!

@Paul Johnston - Thanks a lot for checking out my code!



I can take a screenshot from the iPhone for comparisons at home on my development computer if need be! Attached is a screenshot of what it looks like on my Mac so far. On the iPhone, you can only see about half of that letter 'B' block on the top of the screen, and the bottom red & black floor piece is right on the very bottom of the screen.

Thanks
Senior Software Engineer - RotoGrinders

Attachments

Login to view attachments
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 4th Nov 2015 03:05
Matty H was on the right track, you need to adjust the FOV to account for the fact that the mobile device might be using a different aspect ratio. This code seems to work for me.



Where 70 is the desired FOV, 70 is the default used by AGK.
Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 4th Nov 2015 05:38
Thanks, guys! That worked beautifully
Senior Software Engineer - RotoGrinders

Login to post a reply

Server time is: 2024-11-25 15:36:55
Your offset time is: 2024-11-25 15:36:55