autocad zoom with opengl

Started by
1 comment, last by greenwire 18 years, 1 month ago
hi, if you have in mind autocad, you can define a square, and zoom all inside the square, can it be made with opengl?
Advertisement
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.
Sean Henley [C++ Tutor]Rensselaer Polytechnic Institute
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.

This topic is closed to new replies.

Advertisement