technical architecture.

Maxscript: Zoom Extents

by on Aug.18, 2008, under maxscript

Who would have thought this would be a pain? All i wanted to do was have a default camera zoom to fit on all objects in a scene, regardless of their size/distrobution.

turns out theres code in the maxscript docs that can do it, but it does it by way of modifying the FOV of the camera to fit. thats all good, as long as you’re not working with hugely varying size objects.. re: how far away from the objects is your camera to start will determine how wide the view is. functional, but not ideal.

here’s a little function snippet that does the same functions, but will create a camera, rig it up to a certain direction, and then move it out on its local Z axis until the set of objects is fully in view.

Again, something i’m using in conjunction with Paul’s Batching script refrenced below.

:

7 Comments for this entry

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!