1 Review of COMPSCI 221  Chapters 1-11 in text  User Interfaces will be addressed as a take- home question.

Slides:



Advertisements
Similar presentations
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 2 2D Graphics: Basics.
Advertisements

Graphics Pipeline.
1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
 Engineering Graphics & Introductory Design 3D Graphics and Rendering REU Modeling Course – June 13 th 2014.
1. What is Lighting? 2 Example 1. Find the cubic polynomial or that passes through the four points and satisfies 1.As a photon Metal Insulator.
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Shading I.
Lecture21 Other Java Gamming technologies – Java3D (This lecture will not be assessed)
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.
Chapter 4 Digital Multimedia, 2nd edition Vector Graphics.
(conventional Cartesian reference system)
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
Objectives Learn to shade objects so their images appear three- dimensional Learn to shade objects so their images appear three- dimensional Introduce.
1 L38 Graphics and Java 2D™ (3). 2 OBJECTIVES In this chapter you will learn:  To understand graphics contexts and graphics objects.  To understand.
SWE 423: Multimedia Systems Chapter 4: Graphics and Images.
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.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer.
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.
Coordinate Systems X Y Z (conventional Cartesian reference system) X Y Z.
CS 480/680 Computer Graphics Shading I Dr. Frederick C Harris, Jr.
CS324e - Elements of Graphics and Visualization Java2D Graphics.
SET09115 Intro Graphics Programming
Basic 3D Graphics Chapter 5. Bird’s Eye View  Basic 3D Graphics –Basic concepts of 3D graphics, rendering pipeline, Java 3D programming, scene graph,
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Java ME & Blackberry APIs for Game Dev Week III. Overview Java 2D API Java 3D API SVG Blackberry APIs
COMP 261 Lecture 14 3D Graphics 2 of 2. Doing better than 3x3? Translation, scaling, rotation are different. Awkward to combine them. Use homogeneous.
Shading (introduction to rendering). Rendering  We know how to specify the geometry but how is the color calculated.
University of Illinois at Chicago Electronic Visualization Laboratory (EVL) CS 426 Intro to 3D Computer Graphics © 2003, 2004, 2005 Jason Leigh Electronic.
COMPUTER GRAPHICS CS 482 – FALL 2014 AUGUST 27, 2014 FIXED-FUNCTION 3D GRAPHICS MESH SPECIFICATION LIGHTING SPECIFICATION REFLECTION SHADING HIERARCHICAL.
Computer Graphics Panos Trahanias ΗΥ358 Spring 2009.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Shapes Properties Binding Chung Ji Hye.
CS324e - Elements of Graphics and Visualization Checkerboard World.
Java3D Overview Scene graph Java 3D classes Describing objects Groups, transforms Behaviors, interpolators Lighting.
2D Graphics: Rendering Details
Computer Graphics. Requirements Prerequisites Prerequisites CS 255 : Data Structures CS 255 : Data Structures Math 253 Math 253 Experience with C Programming.
Chapter 15 Graphics and Java 2D™ Java How to Program, 8/e (C) 2010 Pearson Education, Inc. All rights reserved.
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 Going-through.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
Advanced User Interfaces with Java SD’98 - Session 3206 Ted Faison Faison Computing Inc.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
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 3 2D Graphics: Rendering Details.
Java Graphics. Review 3 kinds of elements in components API? Layout managers Events Extend vs. Implement.
1Computer Graphics Lecture 4 - Models and Architectures John Shearer Culture Lab – space 2
INT 840E Computer graphics Introduction & Graphic’s Architecture.
1 Chapter 3 2D Graphics: Rendering Details  Color spaces, paints stroke types  Affine transforms including translation, rotation, scaling, shearing,
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Vector Graphics Digital Multimedia Chap 이병희
Course Introduction to virtual engineering Óbuda University John von Neumann Faculty of Informatics Institute of Applied Mathematics Lecture and laboratory.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
COMP135/COMP535 Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 4 Lecture 4 - Vector Graphics.
RENDERING Introduction to Shading models – Flat and Smooth shading – Adding texture to faces – Adding shadows of objects – Building a camera in a program.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 9 Lighting and Texturing.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 11 Animation.
CS559: Computer Graphics Final Review Li Zhang Spring 2010.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 5 Basic 3D Graphics.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
OpenGL Shading. 2 Objectives Learn to shade objects so their images appear three-dimensional Introduce the types of light-material interactions Build.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Advanced Java Screen Update Techniques SD’98 - Session 4406 Ted Faison Faison Computing Inc.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Models and Architectures 靜宜大學 資訊工程系 蔡奇偉 副教授 2012.
Mohammed AM Dwikat CIS Department Digital Image.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
Computer Graphics: Illumination
3D Graphics Rendering PPT By Ricardo Veguilla.
Models and Architectures
Models and Architectures
Models and Architectures
Presentation transcript:

1 Review of COMPSCI 221  Chapters 1-11 in text  User Interfaces will be addressed as a take- home question

2 Computer Graphics Modeling: Creating a virtual world. Rendering: Generating a visual image of a scene.

3 Java2D  Graphics2D class manages the rendering  Use a Panel to provide the Graphics context  Use JApplet or JFrame as root container

4 Graphics2D Class  Properties –Foreground color –Font –Stroke –Paint  Capabilities –drawing and filling Shape objects –applying AffineTransforms

5 2D Objects  A 2D object consists of a set of points in a plane  Examples –point –lines, curves –shapes like rectangles, ellipses, arcs, polygons –text and images

6 Parametric Equation  Parametric equation expresses each coordinate in terms of a parameter x = f(t)‏ y = g(t)‏  The parametric equation for an ellipse is x = x 0 + a cos t y = y 0 + b sin t

7 Custom Shapes  Area combines shapes to create more complex objects  Set-theoretic operations –Intersect –Add –Subtract –Exclusive or  PathIterator interface allows Shape object to return an iterator to sub- parts  Path2D constructs an outline from a sequence of lines and curves –moveTo –lineTo –quadTo –curveTo –closePath

8 Coloring Objects  Paint interface supports –Color - create a color by giving the amount od red, green, blue to make the color –Gradients - interpolations between two different colors –Texture - use an image to "color" an object

9 Strokes  The Stroke interface defines a method for creating an outline from a shape  BasicStroke class has the following properties –Width –End style (butt, round, square)‏ –Join style (bevel, miter, round)‏ –Miter limit (limits miters on small angle joins)‏ –Dash pattern and phase

10 Affine Transformation  Maps parallel lines to parallel lines  Common affine transforms in both 2D and 3D –Translation –Rotation –Reflection –Scale –Shear

11 Clipping Path A rendered image may be clipped by a clipping path

12 Text in Java2D  Text is treated as a special kind of geometric object  A Font defines the rendering shapes of all the characters  Geometry of a text string in a particular font is represented by a GlyphVector  Create a Shape from the GlyphVector

13 BufferedImage  A BufferedImage contains –Raster -- holds the pixel values –ColorModel -- specifies how to interpret pixel values  BufferedImage has a create Graphics method which allows you to draw to the image  BufferedImageOps –RescaleOp - scale pixel values linearly –LookupOp - use a table to convert pixel values –ConvolveOp - convolute pixel value with thos of neighbors –ColorConvertOp - pixel-by- pixel color conversion –AffineTransformOp - apply the specified transformation to each pixel

14 Animation  You need a way to make something happen at regular intervals –Change some parameter used by the paintComponent method –call repaint() or revalidate() to cause paintComponent to be called  Timer is a Swing Component –delay can be set –generates an ActionEvent after each delay period –register a Listener to respond to the event

15 3D Model and View

16 Java 3D  High-level API  Scene is represented as a scene graph object –Content branch defines the onjects in the scene –View branch defines how the scene is viewed  VirtualUniverse –SimpleUniverse  Locale  Nodes –Group nodes –Leaf nodes  NodeComponents –attached to one or more nodes

17 Background and Bounds  Default background is black  Create custom background with the Background node –set the color –use an image –use a geometry  Environmental nodes need to be limited in extent –e.g. lights, background –limits amount of rendering to be done  Two ways: –Bounds, node component –BoundingLeaf, a Node  uses a Bounds object

18 Points and Vectors  Point represents position  Vector represents direction  Both can be represented as a tuple  An n-dimensional vector is an n-tuple of numbers –(x 1, x 2, …, x n )‏

19 Shapes in 3D  Use a Shape3D Node to represent visual objects –A Shape3D leaf node usually references Geometry and Appearance node components  Geometry is abstract class with many subclasses –GeometryArray –IndexedGeometryArra y –Text3D

20 GeometryArray  Supports construction of objects using arrays of points, lines and polygons  Defines an array of vertices along with other properties that are associated with them –normals –color (3 or 4 elements)‏ –texture coordinates (2, 3 or 4 elements)‏

21 Transform3D  A higher-level representation for transformations  Has constructors to create from both Matrix objects and from vectors  Also has set and get methods for the internal 4 x 4 matrix  Can also set a particular type of transformation

22 Views  View Volume –represented by a projection matrix  View positioning –represented by a view matrix  View Properties –Projection type –Field of view –Limits to view distance –Size of view plate

23 Projections  A projection maps a point in the virtual world onto a view plane –view plate is a finite window in the view plane –also limit the depth that is rendered  Two types of projection –parallel –perspective

24 Types of Lights  Ambient light –uniform in all directions and locations  Directional light –models a distant light source whose rays are all parallel  Point light –light located at a particular location which emits in all directions –Intensity decreases with distance  Spot light –Like a point source except the direction of the emission is restricted

25 Geometry of Reflection  For perfectly reflective surface –angle of incidence = angle of reflection –no loss of intensity  In reality surfaces aren't perfect –light gets scattered –light can be absorbed  Phong model I = I a k a + I p k d cos  + I p k s cos n  –k a, k d, k s are coefficients for ambient, diffuse and specular reflection for a particular material –n is the shininess coefficient, also a property of the material

26 Appearance  Node component which has components that control various aspects of the appearance of an object. –ColoringAttributes, RenderingAttributes, TransparencyAttributes –PointAttributes, LineAttributes, PolygonAttributes –Material –TextureAttributes, Texture, TexCoordGeneration, TextureUnitState

27 Material  Contains components to control the color contributed by different kinds of lighting –ambient, diffuse, specular –can also contain an emissive color component  Shininess coefficient affects specular reflection  Color target for per-vertex colors

28 Depth Cueing  Atmospheric attenuation effects can be simulated with depth cueing  Blend the objects with background color (or with arbitrary fog color)‏ C = f C 0 + (1 - f) C f  Blending is an increasing function of the distance –linear –exponential –gaussian

29 Texture Mapping  Real surfaces often have a large amount of detail  Use a digital image to provide complex detail with minimal computational cost  Procedural textures use a function to calculate the color at any given point

30 Behavior  Java3D uses behavior to facilitate dynamics in a scene graph  Behavior is a leaf node –Defines actions to be taken when the behavior is activated (waked-up)‏ –Behavior is triggered by wakeup conditions  For interactions, triggers are user generated  For animation, triggers are time-based

31 Interpolators for Animation  Interpolator is an abstract subclass of Behavior –It has a number of predefined subclasses containing typical behaviors needed for animation  For example, Color, Switch, Transparency, Transform  The idea is to set two values for a particular attribute and interpolate values in between as a function of time  Alpha object is used to trigger the changes

32 Alpha  A function of time –usually periodic  Has a range from 0.0 to 1.0

33 User Interfaces  Design principles –User should be in control –Reduce memory load for users –Be consistent  Useability heuristics –Ease of learning and remembering –Efficiency of use –Minimize errors  Facilitate recovery from errors