Graphics in Java Part I. Lecture Objectives Understand the basic concepts of Computer Graphics Learn about Computer Graphics Applications Learn about.

Slides:



Advertisements
Similar presentations
Graphics Pipeline.
Advertisements

CP411 Computer Graphics, Wilfrid Laurier University Introduction # 1 Welcome to CP411 Computer Graphics 2012 Instructor: Dr. Hongbing Fan Introduction.
3D Graphics Rendering and Terrain Modeling
Shared Graphics Skills Cameras and Clipping Planes
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
 Engineering Graphics & Introductory Design 3D Graphics and Rendering REU Modeling Course – June 13 th 2014.
CS 4363/6353 INTRODUCTION TO COMPUTER GRAPHICS. WHAT YOU’LL SEE Interactive 3D computer graphics Real-time 2D, but mostly 3D OpenGL C/C++ (if you don’t.
ICS 415Dr. Muhammed Al-Mulhem1 ICS 415 Computer Graphics Introduction Dr. Muhammed Al-Mulhem March 1, 2009 Dr. Muhammed Al-Mulhem March 1, 2009.
Informationsteknologi Monday, November 12, 2007Computer Graphics - Class 71 Today’s class Viewing transformation Menus Mandelbrot set and pixel drawing.
INTRODUCTION. Painting with numbers! Aspects Modeling Rendering Animation.
HCI 530 : Seminar (HCI) Damian Schofield.
Graphics-1 Gentle Introduction to Computer Graphics Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia.
Graphics-1 Gentle Introduction to Computer Graphics (1) Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia.
IAT 3551 Computer Graphics Overview Color Displays Drawing Pipeline.
Graphics Systems I-Chen Lin’s CG slides, Doug James’s CG slides Angel, Interactive Computer Graphics, Chap 1 Introduction to Graphics Pipeline.
Game Engine Design ITCS 4010/5010 Spring 2006 Kalpathi Subramanian Department of Computer Science UNC Charlotte.
SWE 423: Multimedia Systems Chapter 4: Graphics and Images.
Geometric Objects and Transformations Geometric Entities Representation vs. Reference System Geometric ADT (Abstract Data Types)
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
Advanced Computer Graphics Spring-2011 Kocaeli University Computer Engineering Department.
Cornell CS465 Fall 2004 Lecture 1© 2004 Steve Marschner 1 CS465: Computer Graphics I Professor: Steve Marschner.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
Graphics Graphics Korea University cgvr.korea.ac.kr Introduction to Computer Graphics.
1 Chapter 1: Graphics Systems and Models. 2 Applications of C. G. – 1/4 Display of information Maps GIS (geographic information system) CT (computer tomography)
COMP 261 Lecture 14 3D Graphics 2 of 2. Doing better than 3x3? Translation, scaling, rotation are different. Awkward to combine them. Use homogeneous.
1 Perception and VR MONT 104S, Spring 2008 Lecture 22 Other Graphics Considerations Review.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Programmable Pipelines. Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Computer Graphics Computer Graphics is everywhere: Visual system is most important sense: High bandwidth Natural communication Fast developments in Hardware.
3D Programming Concepts How objects are described in 3D and Rendering Pipelines – A conceptual way of thinking of the steps involved of converting an abstract.
1 CMT Fundamentals of Computer Graphics Revision Dr. Xiaohong Gao BG---Room 2C23 Week 11.
3D Objects Subject:T0934 / Multimedia Programming Foundation Session:12 Tahun:2009 Versi:1/0.
Week 2 - Wednesday CS361.
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.
1 Computer Graphics Week2 –Creating a Picture. Steps for creating a picture Creating a model Perform necessary transformation Lighting and rendering the.
INT 840E Computer graphics Introduction & Graphic’s Architecture.
1 Computer Graphics Week9 -3D Geometric Transformation.
Digital Media Dr. Jim Rowan ITEC 2110 Vector Graphics II.
Programmable Pipelines Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
Vector Graphics Multimedia Technology. Object Orientated Data Types Created on a computer not by sampling real world information Details are stored on.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Digital Media Dr. Jim Rowan ITEC So far… We have compared bitmapped graphics and vector graphics We have discussed bitmapped images, some file formats.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Subject Name: Computer Graphics Subject Code: Textbook: “Computer Graphics”, C Version By Hearn and Baker Credits: 6 1.
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
CS COMPUTER GRAPHICS LABORATORY. LIST OF EXPERIMENTS 1.Implementation of Bresenhams Algorithm – Line, Circle, Ellipse. 2.Implementation of Line,
CISC 110 Day 3 Introduction to Computer Graphics.
Digital Media Dr. Jim Rowan ITEC Vector Graphics Elegant way to construct digital images that –have a compact representation –are scalable –are.
1 Perception and VR MONT 104S, Fall 2008 Lecture 20 Computer Graphics and VR.
Digital Media Lecture 5: Vector Graphics Georgia Gwinnett College School of Science and Technology Dr. Jim Rowan.
Advanced Java Screen Update Techniques SD’98 - Session 4406 Ted Faison Faison Computing Inc.
Mohammed AM Dwikat CIS Department Digital Image.
1 Chapter 1: Introduction to Graphics. 2 What is computer graphics.
Applications and Rendering pipeline
Introduction to Computer Graphics
Rendering Pipeline Fall, 2015.
- Introduction - Graphics Pipeline
Computer Graphics.
CSI-447: Multimedia Systems
Programmable Pipelines
IMAGES.
3D Graphics Rendering PPT By Ricardo Veguilla.
CS451Real-time Rendering Pipeline
Interactive Computer Graphics
Introduction to Computer Graphics
Digital Media Dr. Jim Rowan ITEC 2110.
Dr. Jim Rowan ITEC 2110 Vector Graphics II
Presentation transcript:

Graphics in Java Part I

Lecture Objectives Understand the basic concepts of Computer Graphics Learn about Computer Graphics Applications Learn about the Coordinate System of Computer Graphics Learn about the basic and advanced transformations in Computer Graphics

Lecture Objectives Outline: Graphics Applications What is Computer Graphics? Representations in Graphics Supporting Disciplines Coordinate Systems Basic and Advanced Transformations

Graphics Applications Entertainment: Cinema Pixar: Monster’s Inc. A Bug’s Life (Pixar)

Graphics Applications (Cont’d) Medical Visualization MIT: Image-Guided Surgery Project The Visible Human Project

Scientific Visualization Graphics Applications (Cont’d) Computer Aided Design (CAD)

Training Designing Effective Step-By-Step Assembly Instructions (Maneesh Agrawala et. al) Graphics Applications (Cont’d)

Game Modeling and Simulation GT Racer 3 Polyphony Digital: Gran Turismo 3, A Spec Graphics Applications (Cont’d)

The major application that we will be dealing with extensively in the next coming lectures is that of developing graphical user interfaces  Windows  Menus  Buttons  Textboxes ... Graphics Applications (Cont’d)

What is Computer Graphics? Computer graphics: generating 2D images of a 3D world represented in a computer. Main tasks:  modeling: (shape) creating and representing the geometry of objects in the 3D world  rendering: (light, perspective) generating 2D images of the objects  animation: (movement) describing how objects change in time

Representations in Graphics A) Vector Graphics: Image is represented by continuous geometric objects: lines, curves, etc. B) Raster Graphics: Image is represented as a rectangular grid of colored pixels  PIXEL = PIcture ELement X

Raster Graphics Generic Image processing techniques Geometric Transformation: loss of information Relatively high processing time  in terms of the number of pixels Realistic images, textures,... Examples: Paint, PhotoShop,...

Sample Image Processing Techniques Edge Detection Image Denoising Raster Graphics (Cont’d)

Vector graphics Graphics objects: geometry + color Relatively low processing time  in terms of the number of graphic objects Geometric transformation possible without loss of information (zoom, rotate, …) Examples: PowerPoint, CorelDraw, SVG,... Vector Graphics

Scalable Vector Graphics (SVG) <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" " <svg width="12cm" height="4cm" viewBox=" " xmlns=" version="1.1"> Example polygon01 - star and hexagon <rect x="1" y="1" width="1198" height="398" fill="none" stroke="blue" stroke-width="2" /> <polygon fill="red" stroke="blue" stroke-width="10" points="350,75 379, , , , , , , , ,161" /> <polygon fill="lime" stroke="blue" stroke-width="10" points="850,75 958, , , , ,137.5" />

From Modeling to Processing ImageMath. Model Image Analysis (pattern recognition) Image Synthesis (Rendering) ModelingImage processing

Supporting Disciplines Computer science (algorithms, data structures, software engineering, …) Mathematics (geometry, numerical, …) Physics (Optics, mechanics, …) Psychology (Colour, perception) Art and design

Computer Graphics: Transformations Types of transformations Screen and World Coordinate Systems Matrix representations of transformations 2D Transformations 3D Transformations

Graphical Transformations: Basics There are several standard graphics transformation. All involve plotting images on the screen in terms of points and the lines connecting those points. Each programming language has its own particular constructs for drawing items on the screen. "screen" here includes printer output and invisible background buffers for efficient cached graphics (see Double buffering later) Regardless of language particulars, the various graphics transformations themselves remain logically the same. Here, will deal with the logic of the transformations. Consult language books/manuals re: how to do the mechanics of the actual drawing.

Translation: moving an item from one location to another, e.g., moving thru a room or landscape. Rotation: changing the orientation of an item at a given location, e.g., spinning around. Scaling: changing the size of an item as it appears on the screen, e.g., an item gets larger or smaller. : Clipping: knowing where to stop drawing an item because it partially extends beyond the screen. Graphical Transformations: Basics (Cont’d)

More advanced operations: Hidden surface algorithms: dealing with (removing) aspects of items that are hidden from view. Representing 3D shapes: how to represent 3D items in a 2D medium. Displaying depth relationships: how to achieve realistic perspective. Shading, reflection, ambient lighting: how to achieve realistic lighting effects. In this lecture, will deal only with basics: translation, scaling, and rotation. Graphical Transformations: Advanced

Basic ideas: World vs. Viewport The representation of the world Viewport into that world Representation of world stays the same. View of world changes as you move around in it, i.e., the viewport moves. World and Viewport

Both viewport and the "world" have coordinate systems. The entire computer screen is a set of pixels (short for picture elements). So is a window on the desktop of a screen. So is a canvas inside a window. Pixels form a two-dimensional grid with the coordinates (0,0) being the upper-left and the max number of pixels in each dimension forming the lower-right (say, your system provides 1024,768). So the screen coordinates are as follows: (0,0) (1024, 768) Coordinates

The lines to be drawn are given in world coordinates with the origin fixed at the center of the computer screen, e.g., (1024, 768 resolution means a center point of 512, 384) All the transformations are: applied to the world coordinates then mapped to the real (screen) coordinates. This allows of computation of the logical transformations to be separated from hard details of viewing surface. Do not want to tie the model to available resolution. Mapping from world coordinates to screen coordinates allows us to keep two levels of abstraction separate: model vs. device World Coordinates

To visualize it: x-axis y-axis z-axis (0, 0, 0) in world coordinates (512,384,0) in real coordinates Note that the Z-axis comes "at you" out of the computer screen, perpendicular to both the X-axis and the Y-axis. (512, 384, 0) (512, -384, 0) World Coordinates (Cont’d)

For example: world point (0,0,0) is really (512, 384) when you plot (display) it. world point (100, -20,0) is really (612, 404) when you plot it. Notice: real X coordinate gets larger with positive X world coordinates. Notice: real Y coordinates gets larger with negative Y world coordinates. World Coordinates (Cont’d)

Basic transformations: (for simplicity, 2D) Translation: x' = x + Dx y' = y + Dy where Dx is relative distance in x dimension, Dy is relative distance in y dimension, prime indicates new point in space. Computation: [x' y'] = [x y] + [Dx Dy] P' = P + T Translation

[x' y'] = [x y] + [Dx Dy] Each point gets translated Translation (Cont’d)

Scaling: x' = x * Sx y' = y * Sy where Sx is scale factor for x dimension, Sy is scale factor for y dimension, prime indicates new point in space. Computation: defining S as [ Sx 0 ] [ 0 Sy ] [x' y'] = [x y] * [ Sx 0 ] [ 0 Sy ] P' = P * S Scaling

[x' y'] = [x y] * [ Sx 0 ] [ 0 Sy ] Question: What about stretching unequally in two dimensions? Scaling (Cont’d)

Rotation: x' = xcos  - ysin  y' = xsin  + ycos  where  is angle of rotation and prime indicates new point in space. Computation: [x' y'] = [x y] * [ cos  sin  ] [-sin  cos  ] P' = P * R Note: positive angles are counter-clockwise from x toward y; for negative angles (clockwise) use identities: cos(-  ) = cos , and sin(-  ) = -sin  Rotation

[x' y'] = [x y] * [ cos  sin  ] [-sin  cos  ] Rotation (Cont’d)

Notes on Rotation: There is a difference between: "rotation around center point of object“ and "rotation around origin of Cartesian world" Example: Imagine a ball on a tether mounted to pole Do you want the ball itself to spin around on the end of the tether? Or do you want the ball-and-tether to rotate around the pole? To rotate an object about its own center point: first translate object to origin, then do rotation then translate back Rotation Around a Fixed Point

Translation: P' = P+T Scaling: P' = P*S Rotation: P' = P*R Problem: Have heterogeneous ops (add and multiply) Want homogeneous ops (all multiply) so transformations can be combined... Example: Scale an object while it is moving (i.e., translation) closer or further, while it is spinning (i.e., rotation). Want to do one complex operation, not three separate ones. 2D Transformations: Summary