Hidden Line Removal Applying vector algebra to the problem of removing hidden lines from wire-frame models.

Slides:



Advertisements
Similar presentations
Three-dimensional Shapes (3D)
Advertisements

Hidden Surface Removal CSE 581. Visibility Assumption: All polygons are opaque What polygons are visible with respect to your view frustum?  Outside:
CHAPTER 12 Height Maps, Hidden Surface Removal, Clipping and Level of Detail Algorithms © 2008 Cengage Learning EMEA.
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.

CS 450: Computer Graphics OVERVIEW OF POLYGONS
Computational Geometry & Collision detection
Materials Reminders. Get out your agenda if you see your name below. You need to come to my room tomorrow. Period 2Period 7.
11-1 Space Figures and Cross Sections
A code-walkthrough Commentary on our ‘wfmodel.cpp’ demo-program – an initial ‘prototype’ for 3D wire-frame animations.
Modelling. Outline  Modelling methods  Editing models – adding detail  Polygonal models  Representing curves  Patched surfaces.
Hidden Line Removal Applying vector algebra to the problem of removing hidden lines from wire-frame models.
A code-walkthrough Commentary on our ‘model3d.cpp’ demo-program – an initial ‘prototype’ for 3D wire-frame animations.
Objects in 3D – Parametric Surfaces Computer Graphics Seminar MUM, summer 2005.
Geometric Objects and Transformations Geometric Entities Representation vs. Reference System Geometric ADT (Abstract Data Types)
Geometry is everywhere by : Laura González  Solid figures are 3D figures that have length, width and heigth.  For example :  Sphere Faces:0 Vertices:0.
Bellringer Your mission: Construct a perfect square using the construction techniques you have learned from Unit 1. You may NOT measure any lengths with.
Further Mathematics Geometry & Trigonometry Summary.
1 Year 10 Revision Notes. 2 Revision List 1.Types of Number11. 3-d Shapes 2.Rounding12. Volume 3.Time13. Symmetry 4.The Calendar14. Angles 5.Negative.
Finding Surface Area Math 6. Objectives 1- Represent three-dimensional figures using nets made up of rectangles and triangles, and use the nets to find.
CS 450: Computer Graphics REVIEW: OVERVIEW OF POLYGONS
By: Emily Spoden. Trapezoid I’m a quadrangle that always has one pair of parallel lines.
GCSE Foundation 50 Questions. 1 GCSE Foundation Write the number four million in figures.
Properties of Polygons The students will be able to describe the characteristics of a figure and to identify polygons.
Math 010: Chapter 9 Geometry Lines, figures, & triangles
By: De’Aja Koontz 6 Th Period.  A member of the set of positive whole numbers {1, 2, 3,... }, negative whole numbers {-1, -2, -3,... }, and zero {0}.
Geometry Review. What is a six sided polygon called?
Hosted by Mrs. Zilliox Solid figures AnglesPolygons Symmetry
Geometry CRCT Prep.
2 D or 3 D Learning Objective: Determine the perimeter and area of basic 2 dimensional figuresDetermine the perimeter and area of basic 2 dimensional figures.
POINTS, LINES, AND PLANES. UNDEFINED TERMS Point: a location Terms defined only by examples and descriptions Line: a set of points that goes on infinitely.
Part 6: Graphics Output Primitives (4) 1.  Another useful construct,besides points, straight line segments, and curves for describing components of a.
Math Vocabulary Project By: J’amezz Martin. Integer A whole number; a number that is not a fraction.
INSIDE AND OUTSIDE GEOMETRY By: Dutch Vanderpool.
Digital Media Dr. Jim Rowan ITEC So far… We have compared bitmapped graphics and vector graphics We have discussed bitmapped images, some file formats.
Fourth Grade Geometry Fun with Native American Art.
MCAS Math Terms. Add The process of finding the total number of items when two or more groups of items are joined; the opposite operation of subtraction.
Geometry Review By: Kyle Dykes. Chapter 1 Important Terms – Line: extends in one dimension- – Collinear Points: Points that lie on the same line – Coplanar.
Space Figures & Cross-Sections
Classifying Triangles Measuring Angles in Triangles.
12.1 Exploring Solids.
Solid Figures Vocabulary.
CS COMPUTER GRAPHICS LABORATORY. LIST OF EXPERIMENTS 1.Implementation of Bresenhams Algorithm – Line, Circle, Ellipse. 2.Implementation of Line,
Abney V. Martinez. Tell which shapes are polygons.  A polygon is a closed plane figure made up of line segments.  Each line segment is a side.  The.
Chapter 8 Engineering Geometry
6-1B Exploring Polygons How are polygons classified? How are polygons classified? How do you find the sum of the measures of the interior angles of a convex.
Section 12-1 Exploring Solids. Polyhedron Three dimensional closed figure formed by joining three or more polygons at their side. Plural: polyhedra.
polyhedron a three- dimensional figure whose surfaces are polygons faces edge vertex.
2-D and 3-D Figures Riddle Game.
Fifth Grade Math Vocabulary.
Acute angle: An angle with a measure less than 90º.
CS 376 Introduction to Computer Graphics 02 / 14 / 2007 Instructor: Michael Eckmann.
3D Object Representations. Introduction Line and circle and polygon algorithms- represented simple and smooth object. Some Natural object are neither.
Graphics Graphics Korea University kucg.korea.ac.kr Geometric Primitives 고려대학교 컴퓨터 그래픽스 연구실.
Reflection of Light Reflection – The bouncing back of a particle or wave that strikes the boundary between two media. Law of Reflection – The angle of.
Geometry Unit. Identify the following shapes Important Definitions O Parallelogram: a four sided plane with opposite parallel sides. O Trapezoid: a quadrilateral.
KS3 Mathematics S1 Lines and Angles
Polygons, Perimeter, & Area
Name the polygon by the number of sides.
Goal 1: Using Properties of Polyhedra Goal 2: Using Euler’s Theorem
Opener: How many diagonals does each polygon have
EVERYDAY.
MATH 5TH GRADE UNIT 4 Measurement and Data
Mrs. Daniel’s Geometry Vocab List
3D Rendering Pipeline Hidden Surface Removal 3D Primitives
12-1 Properties of Polyhedra
10-1 Vocabulary Face Edge Vertex Prism Cylinder Pyramid Cone Cube Net
Three-Dimensional Object Representation
EOC Review.
Presentation transcript:

Hidden Line Removal Applying vector algebra to the problem of removing hidden lines from wire-frame models

Convex objects We first focus on modeling convex objects One “outward face” cannot hide another So visible faces can be drawn in any order Examples: barn, cube, and dodecahedron

A non-convex object part of this face is hidden by that face eye of viewer

2D Polygons in 3D space A polygon is a 2-dimensional figure Its edges and corner-points are coplanar It’s a bounded region of an infinite plane Any plane in 3-space can be described by an first-degree (linear) algebraic equation: ax + by + cz = d Alternatively, using vector algebra, a plane can be described using a reference-point Q and a direction-vector N = (a, b, c), as: N QP = 0

Face-Planes of solid objects Any plane surface has two sides When a plane is a surface of a solid object it has an “inside” surface and an “outside” surface (a viewer sees the “outside” one) frontback viewer

Angles and cosines An angle of 90-degrees is a “right” angle Angles less than 90-degrees are “acute” And angles over 90-degrees are “obtuse” right angleacute angle obtuse angle cosine = 0 cosine > 0 cosine < 0

Vectors and dot-products Vectors u = (u x, u y, u z ) and v = (v x, v y, v z ) have a dot-product: uv = u x v x + u y v y + u z v z A vector’s length ║u║ equals sqrt( uu ) A dot-product is related to the cosine of the angle θ between the two vectors: uv = ║u║║v║cosine(θ) So sign of dot-product tells angle’s type

Visibility of face-planes N = outward pointing normal vector D = direction vector (from plane toward viewer’s eye) D N DN > 0 (acute angle θ) outer surface is visible θ

“Hidden” face-plane N θ D N = outward pointing normal vector D = direction vector (from plane toward viewer’s eye) DN < 0 (obtuse angle θ) outer surface is hidden

Format of model’s data-set Added data needed to describe our model Number and Location of vertices as before Edge-list is no longer needed (zero edges) Face-list is the new information to be add Each face is a polygon: number of sides, list of vertices in counter-clockwise order (as viewed from the outside of the model), and the face-color to be used for the face

Example data-set: cube sided: 0, 1, 2, 3 (blue) 4-sided: 1, 0, 7, 6 (green) 4-sided: 2, 5, 4, 3 (cyan) 4-sided: 4, 5, 6, 7 (red) 4-sided: 6, 5, 2, 1 (magenta) Face-List (6 faces) The vertices of each face should be listed in counterclockwise order (an seen from the outside of the cube)

Why counterclockwise order? We need to compute the outward-pointing “normal” vector for each polygonal face (to determine if that outward face is visible) That normal vector is easily computed (as a vector cross-product) if the vertices are listed in counterclockwise order

Recall the cross-product: u×v If u = ( u x, u y, u z ) and v = ( v x, v y, v z ), then w = u×v is given by these formulas: w x = u y v z – u z v y w y = u z v x – u x v z w z = u x v y – u y v x Significance: cross-product w makes a 90-degree angle with both u and v (so it’s normal to a plane containing u and v)

Three consecutive vertices V0 V1 V2 p q p = v1 – v0 q = v2 – v1 p×q will be the outward-pointing normal vector (if v0, v1, v2 occurred in counterclockwise order) p×q

Remembering u x v Here’s a “trick” students use to remember the formula for computing a cross-product It’s based on the “cofactor expansion” rule for 3x3 determinants: a b c e f d f d e d e f = a - b + c g h i h i g i g h

Applying this “trick” i = (1,0,0), j = (0,1,0), k = (0,0,1) u = (u x,u y,u z ) v = (v x,v y,v z ) i j k u x v = u x u y u z v x v y v z = ( u y v z – u z v y, u z v x – u x v z, u x v y – u y v x )

Demo program Our ‘filldemo.cpp’ application reads in the data for a 3D model, determines which of its polygonal faces are visible to a viewer, fills each visible face in its specified color, and then draws the edges of visible faces Datasets: plato.dat, redbarn.dat, plane.dat Also two models for a non-convex object: corner1.dat and corner2.dat (same object)

The ‘bitblit’ technique Our ‘filldemo’ program achieves its smooth animation, not with ‘page-flipping’, but with the so-called ‘bitblit’ method This approach has the advantage that it avoids dependency on Radeon hardware (e.g., using the CRTC_START register)

How ‘bitblit’ is used VRAM Visible page (page 0) Drawing page (page 1) CRTC_START All the drawing is done to page 1 (which never gets displayed) Then after an image has is fully drawn, it is rapidly copied to page 0 (‘bitblit’) (never gets changed)

In-class exercises Try to create the data-sets for some “more interesting” 3D objects, (by writing a C++ program to generate the object’s vertices and the face-lists) Example: An octagonal prism –Divide a circle into eight equal-size angles –Use sine and cosine to locate upper vertices –Use sine and cosine to locate lower vertices –Use number-patterns to generate its ten face-planes