In OpenGL, there are three transformations that the user needs to specify in ord
ID: 3834806 • Letter: I
Question
In OpenGL, there are three transformations that the user needs to specify in order to completely specify the transformation of 3D points to 2D screen pixel coordinates. These are the Modelview, Projection and Viewport. Please specify which of these might need to be updated for each of the following situations.
In OpenGL there are three transformations that the user needs to specify in order to complete specify the transformation of 3D points to 2D screen pixel coordinates. These are the Modelview, Projection and Viewport. Please specify which of these might need to be updated for each of the following situations. The object is rotated 30 degrees from its current position. A. Projection E The program widens the field of view of the scene from a narrow angle to a wide angle. B. Modelview E v The user interactively changes the window size. (Projection is one, what is the other? C. Viewpoint E Using Lookat to view an object from a specified position and orientation.Explanation / Answer
Here is the solution of the given criteria, please have a look:-
1) The object is rotated 30 degrees from its current position:-
In this transformation there is a library known as GLU that contains some utility functions for use with OpenGL. The GLU library includes the method gluPerspective as an easier way to set up a perspective projection.
The command:-
gluPerspective( fieldOfViewAngle, aspect, near, far );
can be used instead of glFrustum.
The fieldOfViewAngle is the vertical angle, measured in degrees, between the upper side of the view volume pyramid and the lower side. Typical values are in the range 30 to 60 degrees. The aspect parameter is the aspect ratio of the view, that is, the width of a cross-section of the pyramid divided by its height. The value of aspect should generally be set to the aspect ratio of the viewport.
============================================================
2) The program widens the field of view of the scene from a narrow angle to wide angle
OpenGL provides 2 functions for GL_PROJECTION transformation. glFrustum() is to produce a perspective projection, and glOrtho() is to produce a orthographic (parallel) projection. Both functions require 6 parameters to specify 6 clipping planes; left, right, bottom, top, near and far planes.
================================================================
3) The user interactively changes the window size(Projection is one, what is the other?)
glViewport() command is used to define the rectangle of the rendering area where the final image is mapped
The viewport transform formula is simply acquired by the linear relationship between NDC and the window coordinates.
================================================================
4) Using Lookat to view an object from a specified position and orientation.
GL_MODELVIEW matrix combines viewing matrix and modeling matrix into one matrix. In order to transform the view (camera), you need to move whole scene with the inverse transformation. gluLookAt() is particularly used to set viewing transform.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.