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

Poi3D models: correct flip axis on loading #687

Closed
wants to merge 2 commits into from

Conversation

Gustl22
Copy link

@Gustl22 Gustl22 commented Mar 3, 2019

I think vtm library works mirror-inverted at y-axis. I notice this with geometry buffer, too. (In code is z-axis, but as model is rotated around x-axis, it's actually the y-axis)
Flip gl front face cause of mirrored model.
Fixes #686.

@Gustl22 Gustl22 changed the title Poi3D models: flip x-axis on loading Poi3D models: flip y-axis on loading Mar 3, 2019
@Gustl22
Copy link
Author

Gustl22 commented Mar 4, 2019

Usually should switch over to libgdx y up convention, but it seems we use a z up coordinate system and fbx-conv always converts to the same output and the wiki seems obsolete. See libgdx/fbx-conv#102 like schedul-xor mentioned already.

@Gustl22
Copy link
Author

Gustl22 commented Mar 4, 2019

Temporary close, cause work on a better implementation.

@Gustl22 Gustl22 closed this Mar 4, 2019
@Gustl22
Copy link
Author

Gustl22 commented Mar 4, 2019

We have following coord systems (without warranty):
coord systems

It seemed, we had these options for models:

  • LibGdx Coord system (current implementation)
    • Export from .blend to .fbx with z-up (-y)-forward rhs, scale 0.01
    • Convert .fbx to .g3db with fbx-conv: automatically rotates 90 degree.
    • Vtm: invert rhs to lhs; (node rotation only seem to work, when gdx model is not already rotated)
  • Vtm Coord system:
    • Export from .blend to .fbx with y-up z-forward rhs, scale 0.01
    • Convert .fbx to .g3db with fbx-conv: should not rotate from description
    • Vtm: invert rhs to lhs; no rotation

Second is not working, as fbx-conv somehow rotates anyway.

I tried a different approach to flip y axis of camera to avoid face flip in gl, no success. So existent PR should be the best solution right now.

I think somewhere I have a fallacy. I cannot explain why blender export z-up (-y)-forward rhs with experimental Apply transform results in upside down model.

However this config should work (also with Apply transform) and fbx-conv:
blender_fbx_export

@Gustl22 Gustl22 reopened this Mar 4, 2019
@devemux86 devemux86 changed the title Poi3D models: flip y-axis on loading Poi3D models: correct flip axis on loading Mar 5, 2019
@devemux86 devemux86 added the bug label Mar 5, 2019
@devemux86 devemux86 added this to the 0.11.0 milestone Mar 5, 2019
@devemux86
Copy link
Collaborator

Thanks, merged via bda4885.

@devemux86 devemux86 closed this Mar 5, 2019
@Gustl22 Gustl22 deleted the mirror_models branch March 5, 2019 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants