Zoom Window Tool [REQUEST]
-
Is there a way to replace SU's native Zoom Window Tool with a new graphic which is a crosshair so that the starting corner of the tool can be accurately placed?
OR
Could a script create a tool identical to the functioning of the native SU Zoom Window Tool which uses a cross hair graphic?
-
Entirely possible - I have the code already to make the selection with cross-hairs. Just need help calculating where to move the camera. Ideas, anyone?

-
Make a class
Rectinside your tool class (which is instantiated with the picked rectangle.)
Have instance methods return it's height and center (in screen pixels.)Save a ref to the current camera eye:
cam = view.camera eye = cam.eyeCalculate a new target as the center of the pick rectangle:
target = view.inputpoint(*rect.center).positionCalulate the new up vector from the directional vector
dir_vec = eye.vector_to(target) up = ? # use trig ?Set the camera:
view.camera.set( eye, target, up )Set the zoom factor, by:
dividing theview.vpheightby the pickrect's height to get the zoom factor to pass as the argument toview.zoom( view.vpheight / rect.height ) -
Here is the non-working tool which needs the
do_zoom()method filled in.
zoom-crosshairs-tool.rb
GitHub Gist: instantly share code, notes, and snippets.
Gist (gist.github.com)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better đź’—
Register LoginAdvertisement