Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 6 Graphics Contents.

Slides:



Advertisements
Similar presentations
COMP 175 | COMPUTER GRAPHICS Remco Chang1/6103b – Shapes Lecture 03b: Shapes COMP 175: Computer Graphics February 3, 2015.
Advertisements

Virtual Realism TEXTURE MAPPING. The Quest for Visual Realism.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 2 2D Graphics: Basics.
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 11 Animation F To understand the.
Graphics Programming: Polygon Filling
Shading in OpenGL Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 6 Graphics Contents F Geometry and.
ENDS 375 Foundations of Visualization Geometric Representation 10/5/04.
6.1 Vis_04 Data Visualization Lecture 6 - A Rough Guide to Rendering.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 2 2D Graphics: Basics F The architecture.
©Larry F. Hodges (modified by Amos Johnson) 1 Shading Models.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 9 Lighting and Texturing F To understand.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Shading Week 5, Wed 1 Oct 2003 recap: lighting shading.
Modeling and representation 1 – comparative review and polygon mesh models 2.1 Introduction 2.2 Polygonal representation of three-dimensional objects 2.3.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
1 Graphics CSCI 343, Fall 2013 Lecture 20 Lighting and Shading III.
Polygon Shading. Assigning color to a shape to make graphical scenes look realistic, or artistic, or whatever effect we’re attempting to achieve But first.
CS-321 Dr. Mark L. Hornick 1 3-D Object Modeling.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
3D Objects Subject:T0934 / Multimedia Programming Foundation Session:12 Tahun:2009 Versi:1/0.
Vertex – A point at which two or more edges meet Edge – A line segment at which two faces intersect Face – A flat surface Vertices, Edges, Faces.
Part 6: Graphics Output Primitives (4) 1.  Another useful construct,besides points, straight line segments, and curves for describing components of a.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 12 Additional 3D Topics.
COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 1 Shading (Shading) & Smooth Shading Graphics.
Computer Graphics An Introduction. What’s this course all about? 06/10/2015 Lecture 1 2 We will cover… Graphics programming and algorithms Graphics data.
Computer Graphics. Requirements Prerequisites Prerequisites CS 255 : Data Structures CS 255 : Data Structures Math 253 Math 253 Experience with C Programming.
Computer Graphics I, Fall 2010 Shading in OpenGL.
Image Synthesis Rabie A. Ramadan, PhD 1. 2 About my self Rabie A. Ramadan My website and publications
Geometric Modeling. Volumetric o Collection device obtains regular grid of measurement values Examples: CT, MRI, PET, Ultrasound o Values are interpreted/visualized.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 3 2D Graphics: Rendering Details.
Geometric Objects and Transformation
Game Programming 06 The Rendering Engine
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
Computer Graphics Basic 3D Geometry CO2409 Computer Graphics Week 5-1.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Geometric Modeling How to design a graphical model? How to create a digital description of a real-world object? Design Digitize.
Shading in OpenGL Ed Angel Professor Emeritus of Computer Science University of New Mexico 1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
Vertices, Edges and Faces By Jordan Diamond. Vertices In geometry, a vertices is a special kind of point which describes the corners or intersections.
RENDERING Introduction to Shading models – Flat and Smooth shading – Adding texture to faces – Adding shadows of objects – Building a camera in a program.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Scan Conversion Week 5, Fri 3 Oct 2003 recap: shading scan conversion: lines.
Chapter Area, Pythagorean Theorem, and Volume 14 Copyright © 2013, 2010, and 2007, Pearson Education, Inc.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 9 Lighting and Texturing.
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.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 11 Animation.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 5 Basic 3D Graphics.
Render methods. Contents Levels of rendering Wireframe Plain shadow Gouraud Phong Comparison Gouraud-Phong.
Introduction to Meshes Lecture 22 Mon, Oct 20, 2003.
CDS 301 Fall, 2008 From Graphics to Visualization Chap. 2 Sep. 3, 2009 Jie Zhang Copyright ©
11-1 Space Figures and Cross Sections Objectives To recognize polyhedra and their parts To visualize cross sections of space figures.
Applications and Rendering pipeline
CS552: Computer Graphics Lecture 35: Rendering. Recap Illumination Model o Light Source and surface o Effect of multiple light source o Colored lights.
POLYGON MESH Advance Computer Graphics
3D Graphics Rendering PPT By Ricardo Veguilla.
Gouraud Shading with Bilinear Interpolation
Chapter 14 Shading Models.
CSC461: Lecture 23 Shading Computation
Vectors, Normals, & Shading
The Graphics Pipeline Lecture 5 Mon, Sep 3, 2007.
Computing Vertex Normals from Arbitrary Meshes
Introduction to Meshes
Points, Lines, and Planes
14 Chapter Area, Pythagorean Theorem, and Volume
Chapter 14 Shading Models.
Computer Graphics Shading in OpenGL
Shading in OpenGL Ed Angel Professor Emeritus of Computer Science
Introduction to Meshes
Presentation transcript:

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 6 Graphics Contents

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 2 Objectives F To understand geometry and appearance, the basic attributes of visual objects F To describe points and vectors F To apply GeometryArray family of classes for constructing geometry F To apply GeometryInfo class for constructing geometry F To use geometric primitives F To use texts and fonts as geometric objects F To use the Appearance class and the associated node component classes

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 3 Points and Vectors Homogeneous coordinates

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 4 Points and Vectors

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 5 Surface Equations Implicit equation Parametric equation

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 6 Surface Represented with Polygons

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 7 Shape3D Node A Shape3D leaf node usually references Geometry and Appearance objects

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 8 Geometry Classes

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 9 PointArray PointArray pa = new PointArray(3, GeometryArray.COORDINATES); pa.setCoordinate(0, new Point3f(0f, 0f, 0f)); pa.setCoordinate(1, new Point3f(1f, 0f, 0f)); pa.setCoordinate(2, new Point3f(0f, 1f, 0f));

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 10 LineArray LineArray la = new LineArray(6, GeometryArray.COORDINATES); Point3f[] coords = new Point3f[6]; coords[0] = new Point3f(0f, 0f, 0f); coords[1] = new Point3f(1f, 1f, 0f); coords[2] = new Point3f(1f, 0f, 0f); coords[3] = new Point3f(2f, 1f, 0f); coords[4] = new Point3f(2f, 1f, 0f); coords[5] = new Point3f(3f, 0f, 0f); la.setCoordinates(0, coords);

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 11 TriangleArray TriangleArray ta = new TriangleArray(6, GeometryArray.COORDINATES); Point3f[] coords = new Point3f[6]; coords[0] = new Point3f(0f, 0f, 0f); coords[1] = new Point3f(1f, 1f, 0f); coords[2] = new Point3f(1f, 0f, 0f); coords[3] = new Point3f(1f, 0f, 0f); coords[4] = new Point3f(2f, 1f, 0f); coords[5] = new Point3f(3f, 0f, 0f); ta.setCoordinates(0, coords);

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 12 QuadArray QuadArray qa = new QuadArray(8, GeometryArray.COORDINATES); Point3f[] coords = new Point3f[8]; coords[0] = new Point3f(0f, 0f, 0f); coords[1] = new Point3f(1f, 0f, 0f); coords[2] = new Point3f(1f, 1f, 0f); coords[3] = new Point3f(0f, 1f, 0f); coords[4] = new Point3f(1f, 1f, 0f); coords[5] = new Point3f(0f, 1f, 0f); coords[6] = new Point3f(0f, 1f, 1f); coords[7] = new Point3f(1f, 1f, 1f); qa.setCoordinates(0, coords);

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 13 StripArray TriangleStripArray TriangleFanArray

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 14 IndexedArray int[] stripIndexCounts = {4, 4}; IndexedTriangleStripArray itsa = new IndexedTriangleStripArray(7, GeometryArray.COORDINATES, 8, stripIndexCounts); Point3f[] coords = new Point3f[7]; coords[0] = new Point3f(0f, 0f, 0f); coords[1] = new Point3f(0f, 1f, 0f); coords[2] = new Point3f(1f, 1f, 0f); coords[3] = new Point3f(2f, 1f, 0f); coords[4] = new Point3f(-1f, 0f, 0f); coords[5] = new Point3f(-1f, -1f, 0f); coords[6] = new Point3f(-2f, -1f, 0f); itsa.setCoordinates(0, coords); int[] indices = {0, 1, 2, 3, 0, 4, 5, 6}; itsa.setCoordinateIndices(0, indices);

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 15 The Tetrahedron F One of five regular polyhedra F Vertices: –(1, 1, 1), (1, -1, -1), (-1, 1, -1), (-1, -1, 1) F Indices: –0,1,2, 0,3,1, 1,3,2, 2,3,0 F Normals: –(1, 1, -1), (1, -1, 1), (-1, -1, -1), (-1, 1, 1) SourceRun

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 16 Surface Normals The surface normal at a point is perpendicular to the tangent plane The cross product is useful for calculating normals

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 17 Normal Calculation Parametric equation Derivatives Normal

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 18 GeometryInfo Class Source Run NormalGenerator Stripifier Utility classes

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 19 Polygon Mesh Vertices Quadangle Source Run

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 20 Primitives Source Run

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 21 Font and Text Font font = new Font(“Serif”, Font.BOLD, 1); FontExtrusion extrusion = new FontExtrusion(); Font3D font3d = new Font3D(font, extrusion); Text3D text = new Text3D(font3d, “Hello”); Text2D text = new Text2D(“Hello”, Color.blue, “Serif”, 16, Font.Italic); Create a Text3D object Create a Text2D object

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 22 Appearance Classes

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 23 Shading Model F Flat shading: a fixed color for a face F Gouraud shading: interpolating vertex colors

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 24 Coloring F The lighting model is applied if the Appearance references a valid Material object and the Material object enables lighting. F If vertex colors are present and not ignored, they are used to render the polygons. The enabling of the vertex colors is controlled by a RenderingAttributes object. When vertex colors are used, the shading mode of the polygons is determined by the ColoringAttributes object. A flat shading assigns a single color to a polygon and a Gouraud shading interpolates the vertex colors in the interior of a polygon. F If lighting is not enabled and the vertex colors of the geometry are not present or ignored, the color specified by the ColoringAttributes object will be used for coloring the geometry. SourceRun