dolfinus / 3DAlloy

LightWeight 3D-viewer for MediaWiki
MIT License
3 stars 4 forks source link

Default scale doesn't always show objects #7

Closed squirrelslair closed 2 years ago

squirrelslair commented 2 years ago

Some (all the ones I tried) STL files don't show up with the default scale. Example: https://wiki.squirrelslair.ca/index.php?title=Mediawiki_Extension_3DAlloy/default_scale_problem

Maybe the default scale needs to check the size of the object to set itself to something where that object will fill the canvas? Or, at least, the default should be much smaller - can always zoom in on something if you know it's there and it looks too small, but if it doesn't show at all because it's too big, that's harder to troubleshoot.

dolfinus commented 2 years ago

Hello.

Automatic size detection of a model will be a useful feature. However, I don't know how it could be implemented.

dolfinus commented 2 years ago

Hello.

I've investigated this issue and found a solution for automatic model rescale. Also I've fixed center detection for .obj models.

Please try v1.5

squirrelslair commented 2 years ago

Tested in v1.5 and both OBJ and STL files now auto scale to a size that fits the viewer and centre in it. Thanks Dolfinus!

dolfinus commented 2 years ago

Your welcome!