dolfinus / 3DAlloy

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

pan and zoom don't work as expected #6

Closed squirrelslair closed 2 years ago

squirrelslair commented 2 years ago

Pan and zoom are not working on my installation either from Firefox or from Edge. Example: https://wiki.squirrelslair.ca/index.php?title=Mediawiki_Extension_3DAlloy/pan_and_zoom_don%27t_work_as_expected

Documentation says

dolfinus commented 2 years ago

Hello.

It looks like zoom and pan are disabled: https://github.com/dolfinus/3DAlloy/blob/0863514282d867f1f216b9deb01c915ead8a4437/modules/OrbitControls.js#L21 https://github.com/dolfinus/3DAlloy/blob/0863514282d867f1f216b9deb01c915ead8a4437/modules/OrbitControls.js#L27

Could you please change these lines on your site and check if it works as expected?

squirrelslair commented 2 years ago

I have tested what you suggested and it fixed the problem. Thanks for figuring out how to fix it. I have submitted a pull request for the fix.

dolfinus commented 2 years ago

I've added options for enabling zoom and pan in both global ($wg3DAlloy) or local (tag/function options). Could you check it please?

squirrelslair commented 2 years ago

I tested panning when enabled through img, parser fn and parser tag, and it works now. I tested panning when enabled through $wg3DAlloy["pan"] = 1; in LocalSettings; that works for the img and the parser tag, but not the parser fn. I tried: `

3d:File:Small.stl|width|height|color |opacity|zoom|pan|norotate|scale|z|style|class

{{#3d:File:Small.stl|200 |200 |0xff00ff|0.8 |1 | | 1 | 10 | | | }} ` and it just rotates the object with the mouse action that pans the other two

dolfinus commented 2 years ago

|1 | | 1 | You've missed 1 for pan argument, so this function is disabled. In such a case right mouse button hold + mouse move works like zoom.

squirrelslair commented 2 years ago

You are absolutely right. I can't believe that, went through the trouble of lining up the two lines like that and still missed it. But when I changed it as you suggested it works: `

3d:File:Small.stl|width|height|color |opacity|zoom|pan|norotate|scale|z|style|class

{{#3d:File:Small.stl|200 |200 |0xff00ff|0.8 |1 |1 | 1 | 10 | | | }} ` So this can be closed. Sorry about that. And thanks for fixing the code!