Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to 3D Computer Graphics and Virtual Reality McConnell text.

Similar presentations


Presentation on theme: "Introduction to 3D Computer Graphics and Virtual Reality McConnell text."— Presentation transcript:

1 Introduction to 3D Computer Graphics and Virtual Reality McConnell text

2 Vectors Vectors have direction and magnitude – generally given in terms of three coordinates and hence the representation is an arrow from the origin to that point Vectors are important for viewpoint, orientation, scaling, rotating and other transformations (3,1,1)

3 Vectors (con’t) Length: ||v||= Addition, scalar multiplication Dot product: Cross-product: vector that is perpendicular to both Courtesy Wikipedia for symbols

4 Camera Point of view of a camera; viewpoint Clipping window is the part of the scene that is visible View direction What is up?

5 Coordinate Systems 3D coordinate system – right or left handed (curl fingers from pos X-axis to pos Y-axis: thumb points pos Z)– Virtools is left-handed, Processing is left-handed, but the y axes (and hence the z axes) point in opposite directions X Virtools Processing Z Y 2D screen coordinate system: X Z Y X Y

6 Coordinate System: 3D Environments Most 3D environments have at least two coordinate systems: a world coordinate system and a local coordinate system for each object (sometimes parts of objects) The world coordinate system does not change The local coordinate system is generally located in the “middle” or in a corner of the object and is set in the 3D modeling program.

7 Coordinate Systems (con’t) Clipping window is the visible area of the 3D scene (it is 2D)- window through which you look Viewport is where on the screen (also 2D) the visible scene appears; uses the coordinate system of the screen The viewport and the clipping window may be different sizes, in which case there is stretching or squishing Aspect ratio= width/height- easier if both clipping window and viewport have same

8 Interplay of 2D and 3D systems There are often 2D objects (buttons, interfaces, screen text) – these are in the 2D system 3D objects must actually be rendered on the screen so they ultimately end up with 2D coordinates This projection onto the screen must take into account the z-position of objects, as well as perspective

9 Orientation Objects in a 3D world have spatial location (position) and orientation Orientation is given in many different forms: pitch, roll, yaw or Euler angles (around each axis); quaternions In Processing can rotate in 2D or in 3D around the axes In the Virtools setup Euler angles are used for orientation

10 Object Representation 3D objects are represented with meshes; points that are joined together in convex, planar polygons (faces); typically these polygons are triangles because then there is assurance that they will be planar The set of points forms the mesh Each face of the mesh may have a material associated with it; these materials can be textures and/or colors Details (and realism) increase with the numbers of polygons

11 Point Representation These representations allow for algorithms for calculation of intersections, collisions, positioning Also have algorithms to find which objects are in front, partial view, occlusion For speed, objects can be surrounded by a bounding box – allows quick calculation of intersections

12 Graphics Pipeline Model the individual objects (color, transformations, realism, where located) and together they constitute a scene Render the scene (lights, shading, camera, etc.) in an image Display the image as output If in a virtual environment have real-time, interaction and navigation


Download ppt "Introduction to 3D Computer Graphics and Virtual Reality McConnell text."

Similar presentations


Ads by Google