Docsity

3D Object Representation and Viewing Transformations in Computer Graphics, Lecture notes of Algorithms and Programming

Partial preview of the text

Download 3D Object Representation and Viewing Transformations in Computer Graphics and more Lecture notes Algorithms and Programming in PDF only on Docsity!

Chapter 7 and 9

Representing 3D Objects

& Viewing Transformation

Institute of Technology Computer Science and IT

Graphics scenes contain many different kinds of objects፡ Trees, flowers, glass, rock, water etc.. There is not any single method that we can use to describe objects that will include all characteristics of these different materials 3D object can be represented in many ways in a graphics application A surface can be analytically generated using its function involving coordinates an object can be represented in terms of its vertices, edges and polygons This scheme of object modeling using polygon elements is the most general method, and is also convenient for applications in various graphics algorithms Curves and surfaces can also be designed using splines by specifying a set of control points Polygon and quadric surfaces provide precise descriptions for simple Euclidean objects such as polyhedrons and

Introduction

2 6/17/21 (^) Computer Graphics Addisu M. AMU – CSIT

3D modeling – process of developing a mathematical representation of any 3D surface of object via specialized software It can be displayed as a 2D image through a process called 3D rendering or used in a computer simulation of physical phenomena. 3D models represent a 3D object using a collection of points in 3D space, connected by various geometric entities such as triangles, lines, curved

Contd…

4

Polygon and Quadric surfaces:

for simple Euclidean objects

Spline surfaces and

construction: for curved

surfaces

Procedural methods: Eg.

Fractals, Particle systems

Physically based modelling

methods

Octree Encoding

Methods:

5 6/17/21 (^) Computer Graphics Addisu M. AMU – CSIT

Modeling:  (^) Define object in local coordinates  (^) Place object in world coordinates (modeling transformation) Viewing:  (^) Define camera parameters  (^) Find object location in camera coordinates (viewing transformation) Projection: project object to the viewplane Clipping: clip object to the view volume Viewport transformation

Overview of 3D Rendering

7 6/17/21 (^) Computer Graphics Addisu M. AMU – CSIT

operations needed to produce views of a 3D scene Generating a view of a 3d scene is similar to taking a photograph of a scene using a camera To take a photo

  • (^) first we place the camera at a particular position
  • (^) then change the direction of the camera
  • (^) point the camera to a particular scene and we can rotate the camera around the 3d object
  • (^) finally, when we put the switch, the scene

Viewing Transformation

8

Viewing pipeline ፡ sequence of transformations that every primitive has to undergo before it is displayed

  • (^) operation of the OpenGL viewing pipeline for 3-D graphics Note: different coordinate system after each transformation Every transformation can be thought of as defining a new coordinate system Steps involved in 3D viewing
  • (^) Specify view volume
  • (^) Projection onto a projection plane
  • (^) Mapping of this projected scene on to the

3D Graphics Pipeline

10 6/17/21 (^) Computer Graphics Addisu M. AMU – CSIT

11

Contd…

Several coordinate systems used in

graphics systems.

  • (^) World coordinates are the units of the scene to be modelled; we select a “window” of this world for viewing
  • (^) Viewing coordinates are where we wish to present the view on the output device; we can achieve zooming by mapping different sized clipping windows (via glOrtho2D())to a fixed-size viewport ; can have multiple viewports on screen simultaneously

Coordinate Systems

13

The clipping window selects; the viewport indicates where on output device and what size Normalized coordinates are introduced to make viewing process independent of any output device (paper vs. mobile phone); clipping normally and more efficiently done in these coordinates Device coordinates are specific to output device: printer page, screen display

Contd…

14

modeling transformation – used to transform primitives so that they construct the 3-D scene we want

  • (^) are normally different for each primitive Once we have transformed all primitives to their correct positions we say that our scene is in world coordinates
  • (^) This coordinate system will have an origin somewhere in the scene, and its axes will have a specific orientation
  • (^) All primitives are now defined in world coordinate system

Contd…

16 6/17/21 (^) Computer Graphics Addisu M. AMU – CSIT

In order to be able to render an image of a scene we need to define a virtual camera to take the picture Just like cameras in real life, virtual cameras must have a position in space, a direction (which way is it pointing?) and an orientation (which direction is ‘up’?)

  • (^) camera position, a ‘look’ vector and an ‘up’ vector

Viewing Transformation

17

Now we know where our primitives are in relation to the virtual camera, we are in a position to ‘take’ our picture ፡ involves ‘projecting’ 3-D primitives onto a 2-D image plane Projection from 3D to 2D – defined by straight projection rays (projectors) emanating from the ‘ center of projection ’, passing through each point of the object, and intersecting the ‘ projection plane ’ to form a projection Two different types of projection

Projection Transformation

19

20