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

Model bounding sphere wrong after forward axis conversion change #6784

Closed
lilleyse opened this issue Jul 8, 2018 · 2 comments
Closed

Model bounding sphere wrong after forward axis conversion change #6784

lilleyse opened this issue Jul 8, 2018 · 2 comments

Comments

@lilleyse
Copy link
Contributor

lilleyse commented Jul 8, 2018

Compare "Milk Truck" ( a 1.0 model) and "Draco Compressed Model" (a 2.0 model) in the 3D Models sandcastle. 1.47 vs 1.46

In 1.47 the pivot point is slightly off.

Removing these lines fixes it, but I haven't looked around enough to know why. Similarly placing them above the other axis conversions works. @emackey would you be able to check this out?

if (model._forwardAxis === Axis.Z) {
    // glTF 2.0 has a Z-forward convention that must be adapted here to X-forward.
    BoundingSphere.transformWithoutScale(boundingSphere, Axis.Z_UP_TO_X_UP, boundingSphere);
}

Noticed in #6559

@emackey
Copy link
Contributor

emackey commented Jul 13, 2018

The transform is needed, but was being applied in the wrong order. PR incoming.

@emackey
Copy link
Contributor

emackey commented Jul 13, 2018

This sample file can be used for testing: OffsetCube.zip

It is a cube that is offset from the origin by different amounts on all 3 axes. It won't be shown in the center of the view if you just comment out the Z-forward transform. The transform has to be applied in the correct order to center the cube properly.

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

No branches or pull requests

2 participants