-
Notifications
You must be signed in to change notification settings - Fork 31
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
Adding camera bounds cause incorrect bounding box estimation #47
Comments
Looks good - a slight simplification would be |
awesome. should I make a PR or...? |
Yes, that would be great :) |
when could I expect this change to make it onto crates.io? I'd love to be able to just cargo install with a version rather than with a git url and sha. |
Here it is: https://crates.io/crates/gltf-viewer :) |
wow, thank you for the quick reply and publish! I really appreciate it! |
gltf-viewer/src/render/node.rs
Lines 109 to 113 in 847bf5f
I stumbled onto this TODO after trying to take a screenshot of a model with a camera, but using bounding box estimation. It seems that the camera bounds are being taken into account when trying to set a nice camera position, causing the bounding box to be incorrectly estimated.
Here is the screenshot produced by gltf-viewer:
![heart-render-1080](https://user-images.githubusercontent.com/103545/43974200-cf887fa4-9ca7-11e8-93d4-eb47e1724803.png)
And here is the scene view in Houdini, notice the small camera dot in the bottom left:
![screenshot from 2018-08-10 13-40-41](https://user-images.githubusercontent.com/103545/43974224-e01e212a-9ca7-11e8-87c6-ad785099c645.png)
I'm attempting to get the camera node's bounds to not count in the scene bounds, but my Rust knowledge is very limited. I hacked together this diff that seems to resolve the problem:
Is this the correct solution? Do you have any other ideas about how to fix this?
The text was updated successfully, but these errors were encountered: