hizamoussama / jsc3d

Automatically exported from code.google.com/p/jsc3d
0 stars 0 forks source link

Zoom function #38

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I would like to zoom in/out from a javascript buttons but I'm not sure how to 
code this.  Here is the line from the jsc3d.js file that I would need to 
execute:

this.zoomFactor *= this.mouseY <= e.clientY ? 1.11 : 0.9;

Any help would be greatly appreciated.  Also thank you for all your hard work 
with jsc3d, I'm finding a lot of uses for it.

Original issue reported on code.google.com by ladanyi....@gmail.com on 5 Aug 2013 at 9:29

GoogleCodeExporter commented 8 years ago
That's really easy. Setting 'zoomFactor' to a value greater than 1 will perform 
zoom-in effect; otherwise, it will be a zoom-out.

Original comment by Humu2...@gmail.com on 5 Aug 2013 at 1:46

GoogleCodeExporter commented 8 years ago
Thank you for the quick response, I got the following to work (for anyone else 
who's looking for this).  Thank you again.

function SetZoom()
{
viewer.zoomFactor = 100;
viewer.update();
}

Original comment by ladanyi....@gmail.com on 5 Aug 2013 at 2:02