640 likes | 836 Views
Computer Graphics. Assistant Prof. Dr. Aybars UGUR. Contents. What is computer Graphics 3D Transformations 3D Object Representations Application Areas of Computer Graphics Major Subfields of CG Game Engines 3D Application Programming Interfaces
E N D
Computer Graphics Assistant Prof. Dr. Aybars UGUR
Contents • What is computer Graphics • 3D Transformations • 3D Object Representations • Application Areas of Computer Graphics • Major Subfields of CG • Game Engines • 3D Application Programming Interfaces • 3D Application Programming Interfaces for Mobile Devices • Java 3D FACHHOCHSCHULE GIESSEN-FRIEDBERG
Computer Graphics (CG) • Computer Graphics is a subfield of computer science. • Studies digitally synthesizing and manipulating visual content using computational techniques. • All aspects of producing pictures or image using a computer. FACHHOCHSCHULE GIESSEN-FRIEDBERG
3D Computer Graphics • Graphics that use a three-dimensional representation of geometric data that is stored in the computer. FACHHOCHSCHULE GIESSEN-FRIEDBERG
out in computer image data o i traditional computing computer graphics data computer vision image processing image What is computer graphics about? FACHHOCHSCHULE GIESSEN-FRIEDBERG
y x z y P1 P1' x z 3D Transformations • Some Mathematical Background Translation, Rotation Scaling, etc. FACHHOCHSCHULE GIESSEN-FRIEDBERG
3D Object Representations • B-Representation • Sweep Representations • CSG Methods • Splines • Quadrics FACHHOCHSCHULE GIESSEN-FRIEDBERG
(S4) Top Face Back Face (S0) y Left Face (S2) Right Face (S5) x z Bottom Face (S1) (S3) Front Face Boundary Representations (B-rep) • Describe a 3D object as a set of surfaces that seperate the object interior from the environment. • A cuboid consists of six faces or rectangular polygons (front, left, back or rear, right, bottom, and top), eight vertices, and twelve edges. FACHHOCHSCHULE GIESSEN-FRIEDBERG
Sweep Representations • Idea is to define a 2D shape and then a sweep which will move the shape through 3D space to create a 3D object. FACHHOCHSCHULE GIESSEN-FRIEDBERG
Sweep Representations • A sweep can follow any path. • The object being swept can vary in size along the path. • A simple 2D curve can produce interesting3D shapes. FACHHOCHSCHULE GIESSEN-FRIEDBERG
Constructive Solid-Geometry Methods(CSG) • Given two 3D objects, create new ones with the set operations of • union • intersection • difference Top subtracted from bottom yields A flute made from a cylinder, 1 ellipsoid and 8 circles where the ellipsoid and 8 circles are subtracted from the cylinder. FACHHOCHSCHULE GIESSEN-FRIEDBERG
What is a Spline Curve? • In computer graphics, the term refers to any composite curve formed with polynomial sections satisfying some specified continuity conditions at the boundary of the pieces. • There are many different types of spline curves and we will investigate only a few of them here. FACHHOCHSCHULE GIESSEN-FRIEDBERG
Interpolating and Approximating Splines • We specify a spline curve by giving a set of coordinate positions in 2D. • The coordinates are either interpolated or approximated using points called control points. FACHHOCHSCHULE GIESSEN-FRIEDBERG
Interpolating and Approximating • Interpolation is often used to digitize drawings or specify animation paths. • Approximation is used predominately as a design tool to create object shapes. • Although we are talking about curves right now, these curves can be used to create 3D surfaces such as FACHHOCHSCHULE GIESSEN-FRIEDBERG
Working with Splines • Spline curves (and surfaces) are defined, modified, and manipulated with operations on the control points. • The designer selects (often interactively) locations for the control points and these influence the position and shape of the curve. • By repositioning the control points, the curve can be shaped by eyeballing it and adjusting its shape until it is what is desired. FACHHOCHSCHULE GIESSEN-FRIEDBERG
Splines Have Many Nice Characteristics for Graphics • Geometric transformations only must be applied to the control points and then the curve can be regenerated – i.e splines can be manipulated easily just like polygons. • Given a set of points, the convex hull of the points (in 2D) is the smallest set containing all the points that is convex. • Intuitively, think of a rubber band being stretched to include all the points – that would define the convex hull. FACHHOCHSCHULE GIESSEN-FRIEDBERG
Splines Have Many Nice Characteristics for Graphics • For most splines, the curve lies in the convex hull of the control points This property means the curve will not deviate too far from the control points. In particular, wild oscillations won’t occur. FACHHOCHSCHULE GIESSEN-FRIEDBERG
3D Graphics Pipeline WORLD SCENE/OBJECT Modelling coordinates: - world coordinate system, - object coordinate system 3D MODELLING VIEWING 3D CLIPPING Camera coordinates PROJECTION Screen/Window coordinates RASTERIZATION Device coordinates 2D PIXELMAP DISPLAY FACHHOCHSCHULE GIESSEN-FRIEDBERG
Application Areas of Computer Graphics • CAD - Computer Aided Design • Education and Training • Entertainment • Scientific Visualization • Virtual Reality • Web and Web3D FACHHOCHSCHULE GIESSEN-FRIEDBERG
CAD (Computer Aided Design) is the use of computer technology to aid in the design of a product. Some Fields of Use: • The Architecture, Engineering, and Construction Industry • Mechanical Engineering • Product Design (Textile, Food, Computers, Electronic Devices, etc.) • Automotive, Aerospace, … FACHHOCHSCHULE GIESSEN-FRIEDBERG
CAD - I Los Angeles Airport FACHHOCHSCHULE GIESSEN-FRIEDBERG
CAD - II Boeing 777 FACHHOCHSCHULE GIESSEN-FRIEDBERG
Entertainment - I Computer Graphics in movie industry FACHHOCHSCHULE GIESSEN-FRIEDBERG
Entertainment FACHHOCHSCHULE GIESSEN-FRIEDBERG
Entertainment - II Games FACHHOCHSCHULE GIESSEN-FRIEDBERG
Education and Training - I • Computer generated models of physical, financial, political, social, economic, and other systems are often used as educational aids. • Aircraft, naval, and spacecraft simulators • Simulators for practice sessions or training of ship captains, aircraft pilots, heavy equipment operators, and air traffic control personnel. FACHHOCHSCHULE GIESSEN-FRIEDBERG
Education and Training - II Flight Simulator FACHHOCHSCHULE GIESSEN-FRIEDBERG
Virtual Reality (VR) Virtual Reality (VR) is a computer system used to create an artificial world in which the user has the impression of being in that world and with the ability to navigate through the world and manipulate objects in the world. VR is a technology, which allows a user to interact with a computer simulated environment, be it a real or imagined one. FACHHOCHSCHULE GIESSEN-FRIEDBERG
Data Gloves, Head Mounted Display FACHHOCHSCHULE GIESSEN-FRIEDBERG
HMD FACHHOCHSCHULE GIESSEN-FRIEDBERG
Scientific VisualizationI • Scientific, engineering and medical data. • High number of data. • Complex structures (medical, …) • Simulation of complex process • Complex molecular structure • such as protein and DNA • weather forecasting • Complex mathematical object FACHHOCHSCHULE GIESSEN-FRIEDBERG
Web and Web3D The Web3D Consortium is an international organization established to define and promote standards for 3D graphics representation on the World Wide Web. From the perspective of the Web3D Consortium, “Web3D” is an overarching term to describe protocols, languages, file formats, and other technologies that are used to deliver compelling 3D content over the World Wide Web. X3D, Java 3D and VRML are some of the key Web 3D Technologies. FACHHOCHSCHULE GIESSEN-FRIEDBERG
Major subfields of CG • Geometry (studies representation of three-dimensional objects ) • Animation (studies descriptions for surfaces that move or deform over time) • Rendering • Imaging FACHHOCHSCHULE GIESSEN-FRIEDBERG
Rendering • Converts a model into an image • Result is physically-based photorealistic images Illumination, Reflection, Refraction, etc. FACHHOCHSCHULE GIESSEN-FRIEDBERG
Texture Mapping FACHHOCHSCHULE GIESSEN-FRIEDBERG
Ray Tracing FACHHOCHSCHULE GIESSEN-FRIEDBERG
Image Processing Image processing is any form of signal processing for which the input is an image, such as photographs or frames of video; the output of image processing can be either an image or a set of characteristics or parameters related to the image. FACHHOCHSCHULE GIESSEN-FRIEDBERG
Vector Graphics vs. Raster Graphics • Macromedia flash is vector based • JPG images are raster based • Time to transmit vs. time to generate • Reuse of image description FACHHOCHSCHULE GIESSEN-FRIEDBERG
Vector Graphics • A line is represented by endpoints (20,20) to (100,100) • If you want the image larger, no problem… FACHHOCHSCHULE GIESSEN-FRIEDBERG
Raster Graphics • A line is represented by assigning some pixels a value of 1. • The entire line is specified by the pixel values • What do we do to make image larger? FACHHOCHSCHULE GIESSEN-FRIEDBERG
Colors • Color in CG is commonly specified in RGB format. • A color in RGB format is a triplet of numbers. The three components are Red, Green and Blue. • Other Color Models? Blue Red Green FACHHOCHSCHULE GIESSEN-FRIEDBERG
GAME ENGINES • Game Engine • 3D engine • Sound Engine • Input Engine • Network Engine • Physics Engine • AI Engine • GUI Engine FACHHOCHSCHULE GIESSEN-FRIEDBERG
TORQUE GAME ENGINE GAME ENGINE MAP EDITOR TEXTURE GENERATORS MODEL GENERATORS FACHHOCHSCHULE GIESSEN-FRIEDBERG
3D Application Programming Interfaces For writing applications that produce 2D and 3D computer graphics. • PHIGS (1990’s) • OPENGL was developed by Silicon Graphics Inc. (SGI) in 1992 and is widely used in CAD, VR, scientific visualization, It is also used in video games, where it competes with Direct3D on MS Windows platforms • Java 3D is a scene graph-based 3D application programming interface (API) for the Java platform. It runs on top of either OpenGL or Direct3D. FACHHOCHSCHULE GIESSEN-FRIEDBERG
Java–based 3D APIs • Java 3D is not the only high-level API option to render 3D in Java. In part due to the pause in development during 2003 and 2004, several competing Java scene graph technologies emerged: • General purpose: • AgentFX • Strata Live 3D • Gaming: • Xith 3D • jMonkey Engine • Espresso3D • Visualization: • Aviatrix 3D • JView • Jreality. http://www3.math.tu-berlin.de/jreality/ JOGL is a popular alternative to scene graph APIs FACHHOCHSCHULE GIESSEN-FRIEDBERG
3D Application Programming Interfaces For Mobile Devices • The Mobile 3D Graphics API, commonly referred to as M3G, is a specification defining an API for writing Java programs that produce 3D computer graphics. M3G is not Java 3D. M3G was designed to meet the specific needs of mobile devices, which are constrained in terms of memory, memory bandwidth, and processing power. • OpenGL ES (OpenGL for Embedded Systems) is a subset of the OpenGL 3D graphics API designed for embedded devices such as mobile phones, PDAs, and video game consoles. FACHHOCHSCHULE GIESSEN-FRIEDBERG
3D Application Programming Interfaces For Mobile Devices FACHHOCHSCHULE GIESSEN-FRIEDBERG
Java3D’s SceneGraph VirtualUniverse Locale Root group BG BG TG robot arm environment TG TG view sphere TG base S S TG bottom arm S up arm S FACHHOCHSCHULE GIESSEN-FRIEDBERG