efindley
07-22-2004, 04:53 AM
Hey all,
I am extremely new to OpenGL but I've had to jump right in and sink or swim for a project at work. I am writing a program that allows users to dynamically create models we want to display in 3d. I have the model drawing (at least the basic structures) completed and have a hard coded perspective view (using gluPerspective) that works with my test file so I can see it.
My question is this: Since this is a dynamically generated model, I want to be able to implement essentially a "Zoom to Extent" function. I know all the max and min values for x, y, and z in my model. How do I create a view so that the entire model is visible in the viewport? I also know the vector and angle of rotation at all times -- the rotation is interactively defined. I'm still too fuzzy on the projection functions to be able to work it out in my head. :confused:
Any help would be greatly appreciated. Thanks.
I am extremely new to OpenGL but I've had to jump right in and sink or swim for a project at work. I am writing a program that allows users to dynamically create models we want to display in 3d. I have the model drawing (at least the basic structures) completed and have a hard coded perspective view (using gluPerspective) that works with my test file so I can see it.
My question is this: Since this is a dynamically generated model, I want to be able to implement essentially a "Zoom to Extent" function. I know all the max and min values for x, y, and z in my model. How do I create a view so that the entire model is visible in the viewport? I also know the vector and angle of rotation at all times -- the rotation is interactively defined. I'm still too fuzzy on the projection functions to be able to work it out in my head. :confused:
Any help would be greatly appreciated. Thanks.