Closed ox closed 6 years ago
Looks good - a slight simplification would be else if self.camera.is_some()
.
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!
https://github.com/bwasty/gltf-viewer/blob/847bf5f05af17a4937fff10195fc9c00e58299f5/src/render/node.rs#L109-L113
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:
And here is the scene view in Houdini, notice the small camera dot in the bottom left:
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?