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 / 2.0.14d --> 2.0.16 - CameraPosition or CameraFOV difference?

Author
Message
Nieb
10
Years of Service
User Offline
Joined: 13th May 2014
Location: Lurking
Posted: 9th Jan 2016 05:14 Edited at: 9th Jan 2016 05:17
I've just updated to 2.0.16.
After compiling my game, with no code changes, the camera is quite different. Has something changed with FOV or Position?
The changelog seems a bit out of date.
http://www.appgamekit.com/documentation/whats_new.html

BEFORE:


AFTER:
Preben
AGK Studio Developer
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 9th Jan 2016 11:42
I remember something like this, try:

SetCameraFOV(1,45)

As a remember fov was at some point default 45 or 50 , and then changed to default 70 when the 3d stuff was started

best regards Preben Eriksen,
Nieb
10
Years of Service
User Offline
Joined: 13th May 2014
Location: Lurking
Posted: 9th Jan 2016 11:47 Edited at: 9th Jan 2016 11:59
The default settings aren't being used.
Currently these setting are used in this game:



Is FOV now horizontal instead of vertical?
Preben
AGK Studio Developer
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 9th Jan 2016 15:28
Quote: "Is FOV now horizontal instead of vertical?"
?

Wierd it looks like the camera is closer now , try SetCameraPosition(1,0,0,-65) , but cant see why ?


best regards Preben Eriksen,
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 11th Jan 2016 16:05
There was a change in 2.0.13 to 2.0.14 where FOV was made horizontal instead of vertical, and it remains horizontal in the latest version, but I can't recall any other changes to FOV recently.
Nieb
10
Years of Service
User Offline
Joined: 13th May 2014
Location: Lurking
Posted: 18th Jan 2016 02:26 Edited at: 20th Jan 2016 03:02
Thanks for the info Paul!

I've reworked TossIt, now working on Spun. It used an FOV of 1, which means it would need an FOV of 0.5625 to get the same effect.

Can I bother you for:
an Orthographic rendering mode (FOV 0)
and/or
the ability to choose vertical or horizontal FOV
and/or
FOV supporting floating values.
Nieb
10
Years of Service
User Offline
Joined: 13th May 2014
Location: Lurking
Posted: 10th Apr 2016 06:24 Edited at: 12th Apr 2016 03:14
I understand the Orthographic mode is easier said than done and floating values for FOV probably not worth implementing.

But can I bother you again for an option to toggle FOV being set Horizontal or Vertical?
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 12th Apr 2016 03:03
The FOV command should support float values, but I had a boundary check where anything less than 1 got clamped to 1. I've reduced the clamp to 0 for the next version and made 0 a special case that will generate an orthographic matrix with width 40 world units (and height determined by the camera aspect ratio).
Nieb
10
Years of Service
User Offline
Joined: 13th May 2014
Location: Lurking
Posted: 12th Apr 2016 04:50 Edited at: 12th Apr 2016 05:25
Thanks for the reply. Great to see an orthographic-mode coming!

I am considering releasing a PC version of Spun. The image below shows an issue I'm currently having.
I have seen a wide variety of aspect ratios on phones (16:9,16:10,etc) so i setup the code below to compensate for it.

However working with horizontal resolutions and Horizontal-FOV on PC, it zooms in on the 3D stuff too much.
Suppose i could just ditch the SetScissor and have vertical letter-boxing..

Quote: "(and height determined by the camera aspect ratio)"

If I understand this correctly, I think I would still have this issue with orthographic.

Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 14th Apr 2016 17:07
In that case you will need to modify the FOV based on the device aspect ratio. A rough approximation would be FOV = (DesiredFOV * GetDeviceWidth) / GetDeviceHeight.

You are correct that the orthographic projection would suffer from the same problem, I'll add the command SetCameraOrthoWidth to modify this value, so you can make the same kind of adjustment based on the device aspect ratio.
Jeff Miller
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: New Jersey, USA
Posted: 15th Apr 2016 20:51 Edited at: 15th Apr 2016 21:04
Whoa! If what GetCameraFOV reports happens to change between serial versions of AppGameKit based upon a new preference of importance of vertical vs. horizontal then I'm going to have to be more attentive. I've spent quite a bit of time converting old DBPro programs to AGK. I was diligently inserting in the AppGameKit versions a command to set FOV at 61.9621391296. That was the actual default vertical FOV in DBPro notwithstanding some early incorrect tutorials that TGC published alleging 70, or the original DBPro help files which inelegantly described it as "360/4", a cumbersome way of saying 90. For the last 11 years the DBPro programmers have taken the 61+ figure as gospel because Dimitri published a short code snippet that measured it using 3D math commands. It is the 4th post in this thread:

[href=http://forum.thegamecreators.com/thread/44608]

We assumed this was vertical, and another forum member created a test that verified it.

I happen to have a program which requires that the program know a fairly accurate vertical FOV, (or horizontal if it KNOWS the value to be horizontal) because it must create certain lines which converge at a user's eye position at a prescribed distance from the monitor. It would be a great convenience to be able to have the program read the current FOV, KNOW whether it is vertical or horizontal, and go from there (based upon measured aspect ratios) to make an adjustment without worrying about a change in between AppGameKit versions.

I actually do not have anything near the 3D math skills to comprehend Dimitri's painfully short program at the above link. If any of you folks do, converting it to an AppGameKit snippet would be very much appreciated. My needs are probably rare, and so I don't think they justify asking Paul to do up any new commands to distinguish between vertical and horizontal Get commands. Thus, a short snippet like Dimitri's to measure the values at the beginning of the program would be super.
Nieb
10
Years of Service
User Offline
Joined: 13th May 2014
Location: Lurking
Posted: 16th Apr 2016 07:48
The FOV equation did the job!
Thanks for the support and new features!

Login to post a reply

Server time is: 2024-09-29 13:25:48
Your offset time is: 2024-09-29 13:25:48