Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix and improvement to FBX camera field-of-view during import. #5175

Merged
merged 5 commits into from Jul 23, 2023

Conversation

sfjohnston
Copy link
Contributor

For FBX files, mHorizontalFOV was being computed from the full field-of-view, not from the center to the edge. Scaled by 0.5.

Also, some software (Maya) does not put the field-of-view in FBX, but it can be computed from focal length and image width. This patch detects if FOV hasn't been set in the file and computes it.

This is not an exhaustive fix to FBX cameras, but is an improvement for common uses.

Copy link
Member

@kimkulling kimkulling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments, thanks a lot for the PR!

code/AssetLib/FBX/FBXDocument.h Outdated Show resolved Hide resolved
@@ -55,9 +55,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define _AI_CONCAT(a,b) a ## b
#define AI_CONCAT(a,b) _AI_CONCAT(a,b)

/* Use an 'illegal' default FOV value to detect if the FBX camera has set the FOV. */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use // style comments. This will make it much easier to put bigger blocks into comments.

Copy link
Member

@kimkulling kimkulling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine, thanks!

@kimkulling kimkulling merged commit 60989a5 into assimp:master Jul 23, 2023
11 checks passed
@kimkulling
Copy link
Member

Merged, thanks a lot for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants