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

HAnim conversion to xml inverts rotations #8

Open
andreasplesch opened this issue Jul 16, 2018 · 2 comments
Open

HAnim conversion to xml inverts rotations #8

andreasplesch opened this issue Jul 16, 2018 · 2 comments

Comments

@andreasplesch
Copy link

Converting the Lucy model from
http://www.seamless3d.com/browser_test/lucy_test0.x3dvz
to X3D XML encoding with 3.18 results in this file:
https://raw.githubusercontent.com/andreasplesch/x3dom/HAnim_work/test/functional/HAnim/Lucy_test0.x3d

It seems during conversion the rotations somehow get inverted.

Here is X3D XML encoded scene:
https://raw.githubusercontent.com/andreasplesch/x3dom/HAnim_work/test/functional/HAnim/Lucy_test0b.x3d
converted by
http://doc.instantreality.org/tools/x3d_encoding_converter/
It has correct rotations.

@michaliskambi
Copy link
Member

michaliskambi commented Jul 16, 2018

A workaround, until I find and fix it, seems to be to use command-line conversion:

view3dscene lucy_test0.x3dv --write > new2_lucy_test0.x3dv
view3dscene lucy_test0.x3dv --write --write-encoding=xml > new2_lucy_test0.x3d

These result in correct files, it seems.

See https://castle-engine.io/view3dscene.php#section_converting .

I do not yet have a solution for interactive conversion, I'll debug it. I can confirm that opening + saving http://www.seamless3d.com/browser_test/lucy_test0.x3dvz results in a file that has something weird with rotations :)

Note that saving X3D from view3dscene is like saving the current DOM tree from HTML browser: You save the current state of everything, e.g. all Transform.rotation have values in the middle of the animation. It may be considered a feature or a bug :), but technically, we don't have any choice: we only keep the current X3D graph in memory, we don't try to remember the original graph.
To avoid it, disable events before opening the model (menu item "Animation -> Process VRML/X3D Events"). Or use command-line (view3dscene or tovrmlx3d) to convert the model.

However:

  1. It should not cause weirdness (like inverted rotations).

  2. In this case, I tested opening + saving lucy model when "Process VRML/X3D Events" was disabled. And the resulting file still has weird (inverted) rotations. So the engine is processing something even with "Process VRML/X3D Events" disabled. I'll debug and see what is it:)

@andreasplesch
Copy link
Author

Thanks. Although it is always nice to fix a problem, it may suffice to modify saving from view3dscene so it just calls the command-line, probably in a whole separate process, or add as an option. Just a thought.

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

No branches or pull requests

2 participants