Sign in to follow this  

autocad zoom with opengl

This topic is 4300 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I believe autocad uses openGL (correct me if I'm wrong), so I would assume it is possible. I assume you would have to find a vector from each of the four corners along the view frustrum from the corners of the box. I have no idea about the math involved though.

Edit: Actually, couldn't you just find the center of the rectangle? Then it shouldn't be too bad to find how far forward to move the camera.

Share this post


Link to post
Share on other sites
Quote:
I believe autocad uses openGL

autocad uses autodesks own software driver (heidi) though it can be configured to use opengl or directx.

actually you can only select a window in autocad if you are in an orthographic view, it doesnt work in a perspective view. in fact, you can't do much in autocad in a perspective view.

but i suppose in a perspective view, the rectangle would define the near clipping plane. there's probably some clever way of calculating a camera from that, but i can't help you there.
id probably move the camera (and target) to the center of the rectangle with Z at the world extents, then zoom in until the edge of the rectangle leaves the frustum. or maybe the other way round, start close and zoom out until the rectangle is within the frustum. (hence avoiding the math i dont know)

newer versions of autocad lerp between the original position and the new position creating a groovy real-time zoom.

n.

Share this post


Link to post
Share on other sites

This topic is 4300 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this