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

Slides:



Advertisements
Similar presentations
8.1 Prisms, Area and Volume Prism – 2 congruent polygons lie in parallel planes corresponding sides are parallel. corresponding vertices are connected.
Advertisements

Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
Chapter 12: Surface Area and Volume of Solids

2-D and 3D shapes Riddle Game.
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
Hidden Line Removal Applying vector algebra to the problem of removing hidden lines from wire-frame models.
Objects in 3D – Parametric Surfaces Computer Graphics Seminar MUM, summer 2005.
Definitions and Examples of Geometric Terms
Focus on Can you spell each word correctly ?
Chapter 12 Surface Area and Volume. Topics We Will Discuss 3-D Shapes (Solids) Surface Area of solids Volume of Solids.
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.
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}.
Prisms Fun with by D. Fisher
Geometry Review. What is a six sided polygon called?
Hosted by Mrs. Zilliox Solid figures AnglesPolygons Symmetry
Surface Area and Volume Chapter 12. Exploring Solids 12.1 California State Standards 8, 9: Solve problems involving the surface area and lateral area.
Review of Geometric Shapes
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.
Part 6: Graphics Output Primitives (4) 1.  Another useful construct,besides points, straight line segments, and curves for describing components of a.
Lesson 10-6 Solid Figures.
Math Vocabulary Project By: J’amezz Martin. Integer A whole number; a number that is not a fraction.
Chapter 12 Section 1 Exploring Solids Using Properties of Polyhedra Using Euler’s Theorem Richard Resseguie GOAL 1GOAL 2.
7.1 Three- Dimensional Figures I can classify and draw three-dimensional figures.
Plane figure A two dimensional figure. Chapter 10.
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.
Shape, Space and Measure 2 CyberDesign.co.uk 2005 Volume of a cuboid Volume is the amount of space inside 3-D shapes A cube of 1 cm edge has a volume of.
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.
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.
 Conjecture- unproven statement that is based on observations.  Inductive reasoning- looking for patterns and making conjectures is part of this process.
Polygons and Triangles Chapter 10 Lesson 4 and 5
Geometry Vocabulary. Triangle Triangle: a polygon with three sides. 180⁰ Sum of the interior angles of a triangle = 180⁰.
Section 12-1 Exploring Solids. Polyhedron Three dimensional closed figure formed by joining three or more polygons at their side. Plural: polyhedra.
Chapter 11: Surface Area & Volume
Polygon ProjectPolygon ProjectPolygon ProjectPolygon Project Polygon ProjectPolygon ProjectPolygon ProjectPolygon Project.
MTH 232 Section 9.3 Figures in Space. From 2-D to 3-D In the previous section we examined curves and polygons in the plane (all the points in the plane.
2-D and 3-D Figures Riddle Game.
7.1 Three- Dimensional Figures I can classify and draw three-dimensional figures.
Fifth Grade Math Vocabulary.
CS 376 Introduction to Computer Graphics 02 / 14 / 2007 Instructor: Michael Eckmann.
Geometry Unit. Identify the following shapes Important Definitions O Parallelogram: a four sided plane with opposite parallel sides. O Trapezoid: a quadrilateral.
LAW OF SINE AND COSINE UNIT 5 – 6 USE ON ALL TRIANGLES!!!!
Part 1 Polygons Triangles A triangle is a polygon with 3 sides. VERTEX SIDE A=1/2bh or A=bh/2.
Polygons, Perimeter, & Area
Name the polygon by the number of sides.
Goal 1: Using Properties of Polyhedra Goal 2: Using Euler’s Theorem
Surface Area and Volume
Part 1 Polygons.
EVERYDAY.
MATH 5TH GRADE UNIT 4 Measurement and Data
Mrs. Daniel’s Geometry Vocab List
11.4 Three-Dimensional Figures
12-1 Properties of Polyhedra
14-1 Three-Dimensional Figures and Cross Sections
Three-Dimensional Object Representation
11.4 Three-Dimensional Figures
A polygon is a plane figure with three or more than three segments.
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 were 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

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)

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