Notifications
Clear all

[Closed] Ortographic view zoom factor? How?

I’m trying to get the zoom/scale factor of the current orthographic view.

getViewFOV() in an orthographic view gives me odd numbers.
gw.nonScalingObjectSize() always returns 1.0, regardless.
viewport.GetScreenScaleFactor() gives me a number that I can’t quite figure out, and the fact that you need to pass it a point3 that has no apparent effect is beyond me.

Please help me out guys.

3 Replies

Hi.

Try this:

scaleFactor = gw.nonScalingObjectSize() * (gw.getVPWorldWidth [0,0,0]) / 360.0

I’ve use the point [0,0,0] but depending of what you want, you should use another point.

Take a look at the SDK reference, in the section “ViewExp”. Under the method “NonScalingObjectSize” you’ll find a function that uses this code to calculate the scale matrix needed so that an object keeps its size although the zoom changes.

Hope that helps.

Thanks Half-Vector, that works like a charm!

Thing is that that isn’t in my maxscript documentation… Or do you mean the plugin sdk docs?

Either way, thanks alot.

That’s right.