Learning Objectives 3D Object Representations Polyhedron

Slides:



Advertisements
Similar presentations
OpenGL Computer Graphics
Advertisements

Transformasi 2D (endang_pg)
Texture Mapping Graphics scene tanpa texture -> cenderung polosan-> sepi. Untuk membuat permukaan yang kompleks, jika hanya menggunakan bentuk geometri.
Chapter 13: Solid Shapes and their Volume & Surface Area
Prosedur dan Fungsi.
COMP 175 | COMPUTER GRAPHICS Remco Chang1/6103b – Shapes Lecture 03b: Shapes COMP 175: Computer Graphics February 3, 2015.
3D Game Programming Geometric Transformations
Using GLU/GLUT Objects GLU/GLUT provides very simple object primitives glutWireCube glutWireCone gluCylinder glutWireTeapot.
Faces, Vertices and Edges
1 of 25 Assignment Orthographic Wireframe Elevation Orthographic Wireframe Plan Orthographic Wireframe End-Elevation Perspective View.
1 Computer Graphics Chapter 7 3D Object Modeling.
CS447/ Realistic Rendering -- Solids Modeling -- Introduction to 2D and 3D Computer Graphics.
Curves and Surfaces in OpenGL CS4395: Computer Graphcis 1 Mohan Sridharan Based on slides created by Edward Angel.
3D OBJECT REPRESENTATIONS CEng 477 Introduction to Computer Graphics Fall
Section 2.4 Three Dimensional Shapes MA418 McAllister Spring 2009.
Curves and Surfaces in OpenGL Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
1 Lecture 5 Rendering 3D graphical primitives. 2 3D Rendering Example:
Chapter 12 Surface Area and Volume. Topics We Will Discuss 3-D Shapes (Solids) Surface Area of solids Volume of Solids.
Chapter 12 Surface Area and Volume. Topics We Will Discuss 3-D Shapes (Solids) Surface Area of solids Volume of Solids.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Geometric Objects and Transformations Chapter 4. Points, Scalars and Vectors  Points - position in space  Scalars - real numbers, complex numbers obey.
2003CS Hons RW778 Graphics1 Chapter 6: Polygonal Meshes 6.2 Introduction 6.2 Introduction –Polygonal mesh: collection of polygons (faces) –List of polygons,
Surface Area and Volume Chapter 12. Exploring Solids 12.1 California State Standards 8, 9: Solve problems involving the surface area and lateral area.
Geometry: Part 2 3-D figures.
Chapter 4 10 February Agenda Program 2 – Due 2/17 Chapter 4 – transformations GLUT solids.
How many vertices, edges, and faces are contained in each of the polyhedra? vertices of each polygon polygons meeting at a vertex faces of the polyhedron.
Copyright © Curt Hill Visualization of 3D Worlds How are these images described?
Solid Modeling. Solid Modeling - Polyhedron A polyhedron is a connected mesh of simple planar polygons that encloses a finite amount of space. A polyhedron.
1.7: Three-Dimensional Figures.  Polyhedron - a solid with all flat surfaces that enclose a single region of space  Face – each flat surface  Edges-
Ch 12 and 13 Definitions. 1. polyhedron A solid with all flat surfaces that enclose a single region of space.
In the name of God Computer Graphics Bastanfard. Curve Function(2) Other method is approximate it using a poly-line. Just locate a set of points along.
3D Object Representations graphics scenes contain solid geometric objects trees, flowers, clouds, rocks, water representations surface ↔interior models.
Three-Dimensional Object Representation
PENDAHULUAN Dalam matematika, deret Taylor adalah representasi fungsi matematika sebagai jumlahan tak hingga dari suku-suku yang nilainya dihitung dari.
Section 12-1 Exploring Solids. Polyhedron Three dimensional closed figure formed by joining three or more polygons at their side. Plural: polyhedra.
12.1 Exploring Solids.
Space Figures and Nets Section 6-1 Notes and vocabulary available on my home page.
3D Object Representations. Introduction Line and circle and polygon algorithms- represented simple and smooth object. Some Natural object are neither.
Diamond D’Oveyana & Sylvia
12.1 Exploring Solids Geometry. Defns. for 3-dimensional figures Polyhedron – a solid bounded by polygons that enclose a single region of shape. (no curved.
Chapter 8 Three-dimensional Object Representations PART I
MODEL REGRESI VARIABEL DUMMY A.Sifat Alamiah Variabel-Variabel Dummy Variabel yang diasumsikan nilai 0 dan 1 suatu perangkat untuk menggolongkan data ke.
Computer graphics 3D solid modeling.
Introduction of OpenGL - 3D Graphic and Animation
Geometric Solids POLYHEDRONS NON-POLYHEDRONS.
Goal 1: Using Properties of Polyhedra Goal 2: Using Euler’s Theorem
Polyhedra and Prisms.
Curves and Surfaces in OpenGL
Chapter 11 Extending Geometry
POLYGON MESH Advance Computer Graphics
KEYSHA SALSABILA ABADI VIII-I PRAKARYA. PENGERTIAN BAHAN LUNAK Bahan lunak, yaitu bahan yang memiliki sifat fisik empuk/lunak sehingga sangat mudah dibentuk.
KELAS:8-4. Pengertian bahan lunak Kerajinan bahan lunak merupakan produk kerajinan yang menggunakkan bahan dasar yang bersifat lunak yaitu lentur, lembut,
PRAKARYA UMAIYA BALQIS 8-1. BAHAN LUNAK Bahan adalah material yang memiliki sifat tertentu yang dapat mempengaruhi hasil karya yang dibuat dari matertial.
 Tugas prakarya 8.1 Reza Al Farabi Enjoy !.  Bahan lunak  Bahan adalah material yang memiliki sifat tertentu yang dapat mempengaruhi hasil karya yang.
Nisa damayanti VIII-2 Tugas prakarya. Kerajinan bahan lunak Kerajinan dari bahan lunak merupakan produk kerajinan yang menggunakan bahan dasar yang bersifat.
Nisa damayanti VIII-2 Tugas prakarya. Kerajinan bahan lunak Kerajinan dari bahan lunak merupakan produk kerajinan yang menggunakan bahan dasar yang bersifat.
PRAKARYA  NAMA:M.ARIEL MARDIANSYAH(18)  KELAS:VIII-1(81)  GURU MATPEL:AHMAD MUFTI  MATERI:PENGERTIAN,CONTOH,GAMBAR BAHAN LUNAK SMPN 48 JAKARTA PRAKARYA.
ppt kerajinan bahan lunak 84
PRAKARYA TUGAS 2 (KERAJINAN BAHAN LUNAK) NAMA:KHALIDA TANTRI KELAS:8-3 MAPEL:PRAKARYA.
Kerajinan Bahan Lunak adalah suatu produk kerajinan yang mengunakan bahan bersifat lunak sebagai dasar pembuatannya.
A.ERROR Kesalahan adalah perbedaan antara variabel yang diukur dan setpoint. Kesalahan dapat berupa positif atau negatif. Tujuan dari setiap skema kontrol.
12-1 Properties of Polyhedra
10-1 Vocabulary Face Edge Vertex Prism Cylinder Pyramid Cone Cube Net
Lecture #10 3D Object Representations
Surface Area and Volume
Three-Dimensional Object Representation
Geometry Chapter : Exploring Solids.
14 Chapter Area, Pythagorean Theorem, and Volume
3-Dimensional Object Representation
Presentation transcript:

Learning Objectives 3D Object Representations Polyhedron Quadrics, SuperQuadrics Spline, Bezier Blobby Constructive Solid Geometry

3D Object Representations Graphics scenes melibatkan berbagai jenis objek dan material surfaces Trees, flowers, clouds, rocks, water, bricks, wood paneling, rubber, paper, marble, steel, glass, plastic, etc. Bagaimana merepresentasikan objek 3D pada openGL?

3D Object Representations Untuk merepresentasikan objek 3D, ada beberapa teknik Menggunakan polygon dan quadric untuk membuat objek seperti polyhedrons ataupun ellipsoids Untuk membuat permukaan berkurva seperti pada sayap pesawat, gears, bodi mesin, etc, digunakan Spline surfaces Constructive solid geometry untuk menyusun bentuk geometri dasar menjadi objek komplek Untuk memodelkan pegunungan, awan, tumbuhan, atau air terjun digunakan procedural methods seperti fractals dan particle system

Predefined Objects OpenGL sudah menyediakan fungsi menggambar beberapa objek dasar yang tinggal dipakai. Tak perlu membuat dari awal. Objek-objek dari OpenGL ini dapat disusun untuk membuat bentuk yang kita inginkan Beberapa yang sudah disediakan OpenGL antara lain: Polyhedra Polyhedron functions Quadric Surfaces Superquadrics

Object with Superquadrics

A. Polyhedron A polyhedron is a connected mesh of simple planar polygons that encloses a finite amount of space. Polyhedron adalah rangkaian jala polygon (polygon mesh) dengan kriteria sbb Setiap edge dipakai oleh 2 faces Sedikitnya 3 edge bertemu pada setiap vertex. Faces tidak saling menembus, tetapi berhenti pada suatu edge. Euler’s formula : If F, E, V represent the number of faces, vertices and edges of a polyhedron, then V + F  E = 2.

3D Object Representation The data for polygonal meshes can be represented in two ways. Method 1: Vertex List Normal List Face List (Polygon List) Method 2: Edge List

Surface Normal n

Vertices and Faces - E.g. Cube 2 5 5 4 3 1 1 1 5 6 6 7 7 2 2 3 3 4 Vertex Index Face Index

Data representation using vertex, face and normal lists: xyz axis

Data representation using vertex, face and edge lists:

Normal Vectors (OpenGL)

Regular Polyhedra (Platonic Solids) Jika semua face pada polyhedron adalah identik dan berupa regular polygon, maka polyhedron tsb disebut platonic solid. Hanya ada 5 jenis platonic solid

The Platonic Solids Regular tetrahedron (or triangular pyramid) has 4 faces Regular hexahedron (or cube) with 6 faces Regular octahedron with 8 faces Regular dodecahedron with 12 faces Regular icosahedron with 20 faces

Menggambar polyhedron Ada 2 cara Method1 : Fitting the surface with a polygon mesh. Membungkus permukaan objek polyhedron dengan susunan jala polygon. Proses ini disebut juga dengan surface tesselation Method 2 : Memakai fungsi yang disediakan library GLUT

Method-1 Polygon Mesh In fitting polygons to a surface, we are not limited to using GL_POLYGON We can also use GL_TRIANGLES GL_TRIANGLE_STRIP GL_TRIANGLE_FAN GL_QUADS GL_QUAD_STRIP

Polygon Mesh Polygon mesh ini juga bisa dipakai untuk memodelkan permukaan objek lainnya

Method 2- OpenGL Polyhedron Functions 5 functions produce wire frames which can be easily used Ex: glutWireX(), where X is one of the names Cube, Tetrahedron, Octahedron, Dodecahedron, or Icosahedron (with the first letter capitalized). 5 functions produce polyhedra facets as shaded fill areas - the characteristics of these are determined by material and lighting properties. Ex: glutSolidX(), where X is as above.

GLUT Library of Polyhedron Functions Example: prog8OGLGLUTPolyhedra.cpp

glutWireTetrahedron() and glutWireCube(1.0) 4 faces 6 faces

glutWireOctahedron() and glutWireDodecahedron() 8 faces 12 faces

And, glutWireIcosahedron() 20 faces

B.Quadrics Objek yang didefinisikan sebagai persamaan quadratics Sphere Ellipsoid Torus General form

Quadric surfaces Double cones Ellipsoids Hyperboloids of one sheet Hyperboloids of two sheets

Quadric surfaces Elliptic paraboloids Hyperbolic paraboloids

Superquadrics the squaring operations are replaced by arbitrary powers. Superellipses

Superquadrics Superellipsoids

GLUT Quadric Functions – for Solids, Substitute Solid for Wire glutWireSphere(radius, slices, stacks); glutWireCone(base, height, slices, stacks); glutWireTorus(innerRadius, outerRadius, nsides, rings); and the following is provided also! glutWireTeapot(size);

GLUT Quadric Functions QuadricSurfs.cpp

GLU Quadric-Surface Functions void gluSphere (GLUquadricObj *qobj, GLdouble radius,GLint slices, GLint stacks); void gluCylinder (GLUquadricObj *qobj, GLdouble baseRadius,GLdouble topRadius, GLdouble height,GLint slices, GLint stacks); void gluDisk (GLUquadricObj *qobj, GLdouble innerRadius,GLdouble outerRadius, GLint slices, GLint rings);

GLU Quadric-Surface Functions void gluPartialDisk (GLUquadricObj *qobj, GLdouble innerRadius,GLdouble outerRadius, GLint slices, GLint rings,GLdouble startAngle, GLdouble sweepAngle);

GLU Quadric-Surface Functions Quadric.c

WHY IS THE TEAPOT POPULAR? Pada zaman dahulu belum ada library packages untuk 3D modelling. Pemodelan objek 3D dilakukan dengan tangan, menggambar kurva dan titik2nya dicatat secara manual. Computer graphics researcher Martin Newell, ketika hendak mencari barang untuk dibuat model matematika tak sengaja menemukan teapot Teapot adalah model yang ideal untuk eksperimen 3D modelling, karena Mudah dikenal Topologi yang komplek Mempunyai proyeksi bayangan pada dirinya sendiri Melibatkan topik hidden surface Memiliki permukaan cekung dan cembung, juga saddle points (curved up and down) Doesn't take much storage space

The Utah Teapot The real teapot--- The teapot was donated to the Boston Computer Museum but now resides in the Ephemera collection of the Computer History Museum where it's catalogued as "Teapot used for Computer Graphics rendering" catalogue number X00398.1984.

Many Versions of Teapots From Steve Baker’s History of the Teapot site: http://www.sjbaker.org/teapot/index.html

%^$@ Teapot! From Steve Baker’s History of the Teapot site: http://www.sjbaker.org/teapot/index.html.

wireframe

Lighting & shading

Texture mapped

Multiple Teapots of Various Materials teapots.c

C. Spline Representations Splines are used to design curves and surfaces based on a set of user-defined points Control points Himpunan titik koordinat yang mengontrol bentuk kurva Interpolation Semua control points tersambung satu sama lain pada garis kurva Approximate Semua atau beberapa control points terletak di luar garis kurva

Spline Representations Interpolated Approximate

Bezier Spline Curves Developed by French engineer Pierre Bézier for use in the design of Renault automobile bodies Easy to implement Widely used in CAD systems, graphics, drawing and painting packages

Bezier Curve Equations Diketahui sejumlah n +1 control points, nilai k antara 0 sampai n Persamaan garis Bezier akan membentuk titik-titik garis kurva sesuai control point yang didefinisikan

Bezier Curve Equations Degree 1 – Linear Curve Degree 2 Degree 3 Degree n

Bezier Spline Curves A common use for Bezier curves is in font definition

Bezier Spline Curves If we specify the first and the last control point as the same point, we can generate a closed Bezier curve

Bezier Surfaces Two sets of Bezier curves can be used to design an object surface with pj,k specifying the location of (m+1) by (n+1) control points

Bezier Surfaces u and v parameters

Bezier Surfaces An example Bezier surface

OpenGL Approximation Spline Functions Bezier splines and B-splines can be displayed using OpenGL functions The core library contains Bezier functions, and GLU has B-spline functions Bezier functions are often hardware implemented

OpenGL Bezier-Spline Curve Functions We specify parameters and activate the routines for Bezier-curve display with glMap1*(GL_MAP1_VERTEX_3, uMin, uMax, stride, nPts, *ctrlPts); glEnable(GL_MAP1_VERTEX_3); and deactivate with glDisable(GL_MAP1_VERTEX_3); uMin and uMax are typically 0 and 1.0 stride=3 for 3D nPts is the number of control points ctrlPts is the array of control points

OpenGL Bezier-Spline Curve Functions After setting parameters, we need to evaluate positions along the spline path and display the resulting curve. To calculate coordinate positions we use glEvalCoord1*(uValue); where uValue is assigned some value in the interval from uMin to uMax

Example OpenGL Code prog8OGLBezierCurve.cpp GLfloat ctrlPts [4][3] = { {-40.0, 40.0, 0.0}, {-10.0, 200.0, 0.0}, {10.0, -200.0, 0.0}, {40.0, 40.0, 0.0} }; glMap1f (GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, *ctrlPts); glEnable (GL_MAP1_VERTEX_3); GLint k; glColor3f (0.0, 0.0, 1.0); // Set line color to blue. glBegin (GL_LINE_STRIP); // Generate Bezier "curve". for (k = 0; k <= 50; k++) glEvalCoord1f (GLfloat (k) / 50.0); glEnd ( ); glColor3f (1.0, 0.0, 0.0); // Set point color to red. glPointSize (5.0); // Set point size to 5.0. glBegin (GL_POINTS); // Plot control points. for (k = 0; k < 4; k++) glVertex3fv (&ctrlPts [k][0]); prog8OGLBezierCurve.cpp

Example OpenGL Code prog8OGLBezierCurve.cpp

OpenGL Bezier-Spline Surface Functions We specify parameters and activate the routines for Bezier surface display with glMap2*(GL_MAP2_VERTEX_3, uMin, uMax, uStride, nuPts, vMin, vMax, vStride, nvPts, *ctrlPts); glEnable(GL_MAP2_VERTEX_3); and deactivate with glDisable(GL_MAP2_VERTEX_3); uMin, uMax, vMin and vMax are typically 0 and 1.0 stride=3 for 3D nuPts and nvPts are the size of the array ctrlPts is the double subscripted array of control points

Example OpenGL Code bezsurf.c GLfloat ctrlpoints[4][4][3] = { {{-1.5, -1.5, 4.0}, {-0.5, -1.5, 2.0}, {0.5, -1.5, -1.0}, {1.5, -1.5, 2.0}}, {{-1.5, -0.5, 1.0}, {-0.5, -0.5, 3.0}, {0.5, -0.5, 0.0}, {1.5, -0.5, -1.0}}, {{-1.5, 0.5, 4.0}, {-0.5, 0.5, 0.0}, {0.5, 0.5, 3.0}, {1.5, 0.5, 4.0}}, {{-1.5, 1.5, -2.0}, {-0.5, 1.5, -2.0}, {0.5, 1.5, 0.0}, {1.5, 1.5, -1.0}} }; glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, &ctrlpoints[0][0][0]); glEnable(GL_MAP2_VERTEX_3); for (j = 0; j <= 8; j++) { glBegin(GL_LINE_STRIP); for (i = 0; i <= 30; i++) glEvalCoord2f((GLfloat)i/30.0, (GLfloat)j/8.0); glEnd(); glEvalCoord2f((GLfloat)j/8.0, (GLfloat)i/30.0); } bezsurf.c

Example OpenGL Code bezsurf.c

Bézier Surfaces: Example Utah Teapot modeled by 32 Bézier Patches

D. Blobby Objects Memodelkan objek yang dapat berubah bentuk tapi volumenya tetap Contoh Water drops Molecules Force fields

Blobby Objects A collection of density functions Equi-density surfaces

Metaballs (Blinn Blobbies)

E.Constructive Solid Geometry Primitives Transformed Combined Bermula dari objek geometri primitive, ditransformasikan dan dikombinasikan membentuk objek yang kompleks