PDA

View Full Version : Ortographic view zoom factor? How?


Wahooney
10-24-2006, 07:09 PM
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.

HalfVector
10-24-2006, 07:41 PM
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.

Wahooney
10-24-2006, 09:07 PM
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.

HalfVector
10-24-2006, 10:47 PM
Or do you mean the plugin sdk docs?
That's right.

CGTalk Moderation
10-24-2006, 10:47 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.