DOC PREVIEW
NU EECS 351 - Lecture Notes

This preview shows page 1-2-3-4 out of 12 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Produce an image of 3D world, in world device coordinatenot interested in entire world, only portionthis portion is called a "window"WIndow is set via some command such asSetWindow2d(xmin, Ymin, Xmax Ymax)Can use the window to change the apparent size and/or location of object in the image.Changing the window affects all of the objects in the imageThese effects are called zooming and panningThey can be done two ways: Setting the window or moving the cameraFirst we will talk about the windowZoomingNow increase the window size and the house appears smaller, i.e., you have zoomed out:Set_window( -60, +60, -30, +30 ) If you decrease the window size the house appears larger, i.e., you have zoomed in:Set_window( -21, +21, -11, +11 )Thus apparent size of image can be changed by changing the window sizeWhat about positionA. Set_window(-40, +20,-15,+15)B.Set_window(-20,+40,-15,+15)Moving all objects in the scene by changing the window is called "panning".---------------------------------------ViewportWindowing system is responsible for opening the window (GLUT)By default in OpenGL, sets the viewport to be the entire set of pixels in the rectangle defined by this window.You can use glViewport() to choose a smaller drawing regionFor example you may want to subdivide the window to create a split-screen effect for multiple views in the same window(See slide on viewport)Can display multiple images in different viewports:Set_window( -30, +30, -15, +15);Set_viewport(0.0, 0.5, 0.0, 0.5); -- lower leftDraw_house;Set_viewport(0.5, 1.0, 0.0, 0.5); -- lower rightDraw_house;Set_viewport(0.0, 0.5, 0.5, 1.0); -- upper leftDraw_house;Set_viewport( 0.5, 1.0, 0.5, 1.0); -- upper rightDraw_house;This gives the following image: ----------------------3D Camera TransformationUse camera analogyviewer observes scene thru camera and can move around the sceneDefine a viewing coordinate system: position and orientation of the cameraalign view coordinate system with world coordinate system -> viewing transformation matrixviewing transformation matrix is applied to all objects moves them into proper position as seen by cameraFirst step : Choosing the VCS origin (in world coordinates). This is the VRP, that is, the position of the camera (observer). Next, we define a projection plane (view plane or image plane). Choose a view plane normal vector, N which determines the positive Z axis direction. Next choose a view up vector, V which determines the positive y axis direction. We are through since the positive U (X) axis is orthogonal to the V (Y) and N (Z) axis.Now that we have defined a VCS (left handed) we must perform a coordinate transformation to align the WCS with the VCS.Problem choosing N and orthogonal vector VSo we use an alternative methodchoose: Eye point, Look at point, and Up vectorNormal to view plane becomes the normalized vector from Eye to Lookatlength of this vector is the view plane distancegluLookAt(..)Defines a viewing matrix and multiplies it to the right of the current matrixIn the default position, the camera is at the origin, is looking down the negative z-axis, and has thepositive y-axis as straight up. This is the same as callinggluLookat (0.0, 0.0, 0.0, 0.0, 0.0, -100.0, 0.0, 1.0, 0.0);The z value of the reference point is -100.0, but could be any negative z, because the line of sight willremain the same. In this case, you don’t actually want to call gluLookAt(), because this is the default(see Figure 3-11) and you are already there! (The lines extending from the camera represent the viewingvolume, which indicates its field of view.)This is the same as doing translation and rotations to get the camera to where you want it.----------3D Viewing Projections Map 3D object to 2D displayTwo General methods: Parallel (orthographic) and PerspectiveParallel Viewing ProjectionsParallel rays (projectors) emanate from a center of projection (the eye)and intersect the projection planeFor Orthographic projections, center of projection is at infinityTwo classes of parallel projectionsorthographic: direction of projection is perpendicular to projection planeoblique projection: direction of projection is not perpendicular to projection planeDraw projection of point to projection plane similar to this (for orthographic and parallel):orthographic: discard the z coordinatesEngineering drawing frequently use front, side, top orthographic views of an object(Maya: modeling)orthographic projection that show more than 1 side of an object are called axonometric orthographic projectionsThe most common axonometric projection is an isometric projection where the projection plane intersects each coordinate axis in the model coordinate system at an equal distance.Isometric ProjectionThe projection plane intersects the x, y, z axes at equal distances and the projection plane Normal makes an equal angle with the three axes.To form an orthographic projection xp = x, yp= y , zp = 0. To form different types e.g., Isometric, just manipulate object with 3D transformations.The projectors are not perpendicular to the projection plane but are parallel from the object to the projection plane????? (error from note copy?)The projectors are defined by two angles A and d where:A = angle of line (x,y,xp,yp) with projection plane,d = angle of line (x, y, xp, yp) with x axis in projection planeL = Length of Line (x,y,xp,yp).Then:cos d = (xp - x) / L ------> xp = x + Lcos d ,sin d = (yp - y) / L ------> yp = y + Lsin d ,tan A = z / LNow define L1 = L / z ----> L= L1 z ,so tan A = z / L = 1 / L1 ; xp = x + z(L1cos d) ; yp = y + z(L1sin d) |1 0 0 0 |P = |0 1 0 0 | |L1cosq L1sinq 1 0 | |0 0 0 1 |Now if A = 90° (projection line is perpendicular to PP) then tanA = infinity => L1 = 0, so have an rthographic projection.Two special cases of oblique projectionA) A = 45° , tanA = 1 => L1 = 1 This is a Cavalier projection such that all lines perpendicular to the projection planeare projected with no change in length. B) tanA = 2, A= 63.40°, L1 = 1 / 2Lines which are perpendicular to the projection planeare projected at 1 / 2 length . This is a Cabinet projection.------------------------------Perspective Viewing ProjectionObjects are projected directly toward the eye and they are drawn where they meet a view plane in front of the eyesize of object is proportional to 1/z for eye at origin looking up at negative z axisy_s = (d/z)*y (for slide image or figure 6.9 of Shirley book)Eye at finite distance


View Full Document

NU EECS 351 - Lecture Notes

Download Lecture Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?