CS378 - Mobile Computing 3D Graphics.

Slides:



Advertisements
Similar presentations
GR2 Advanced Computer Graphics AGR
Advertisements

COMPUTER GRAPHICS SOFTWARE.
Graphics Pipeline.
In the name of God Computer Graphics Bastanfard.
CS 4731 Lecture 2: Intro to 2D, 3D, OpenGL and GLUT (Part I) Emmanuel Agu.
Cosc 5/4730 OpenGL ES An introduction. OpenGL ES GL was first developed by SGI as a priority graphics language – OpenGL was developed initially by SGI.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Adv. Computer Graphics CS6500, Spring 2003.
Graphics Systems I-Chen Lin’s CG slides, Doug James’s CG slides Angel, Interactive Computer Graphics, Chap 1 Introduction to Graphics Pipeline.
Ch 1 Intro to Graphics page 1CS 367 First Day Agenda Best course you have ever had (survey) Info Cards Name, , Nickname C / C++ experience, EOS experience.
3D Rendering with JOGL Introduction to Java OpenGL Graphic Library By Ricardo Veguilla
Perspective, Scene Design, and Basic Animation
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Overview of Computer Graphics Chapter 1. Bird’s Eye View  Overview of Computer Graphics –Basic concept of computer graphics, system, programming platforms,
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 1 Overview of Computer Graphics.
3D Concepts Coordinate Systems Coordinates specify points in space 3D coords commonly use X, Y, & Z A vertex is a 'corner' of an object Different coordinate.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
1 Computer Graphics Week13 –Shading Models. Shading Models Flat Shading Model: In this technique, each surface is assumed to have one normal vector (usually.
Course Overview, Introduction to CG Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Friday, September 5, 2003.
CS 480/680 Computer Graphics Course Overview Dr. Frederick C Harris, Jr. Fall 2012.
What is ? Open Graphics Library A cross-language, multi-platform API for rendering 2D and 3D computer graphics. The API is used to interact with a Graphics.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Computer Graphics Computer Graphics is everywhere: Visual system is most important sense: High bandwidth Natural communication Fast developments in Hardware.
INTRO TO COMPUTER GRAPHICS TEXT EDWARD ANGEL: EDITION 5 CS770/870
UniS CS297 Graphics with Java and OpenGL Introduction.
CSE 381 – Advanced Game Programming Basic 3D Graphics
Week II Platforms and Engines. Overview Platforms and Engines Tools and SDKs Netbeans Game Development Walkthrough
Linear Interpolation, Brief Introduction to OpenGL Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, September.
3D Objects Subject:T0934 / Multimedia Programming Foundation Session:12 Tahun:2009 Versi:1/0.
Advanced Computer Graphics March 06, Grading Programming assignments Paper study and reports (flipped classroom) Final project No written exams.
3-D Views of Solid Figures
3D API By Clayton Azzopardi (Group 10). Introduction Android uses the OpenGL ES 1.0 API Android uses the OpenGL ES 1.0 API Open Graphics Library for Embedded.
CSC 461: Lecture 41 CSC461: Lecture 4 Introduction to OpenGL Objectives: Development of the OpenGL API OpenGL Architecture -- OpenGL as a state machine.
Computer Graphics. Requirements Prerequisites Prerequisites CS 255 : Data Structures CS 255 : Data Structures Math 253 Math 253 Experience with C Programming.
UniS CS293 Graphics with Java and OpenGL Introduction.
Buffers Textures and more Rendering Paul Taylor & Barry La Trobe University 2009.
1 Chapter 1 Overview of Computer Graphics  To understand the basic objectives and scope of computer graphics  To identify computer graphics applications.
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
Lesson 10-2: 3-D Views of Solid Figures 1 3-D Views of Solid Figures Lesson 10-2.
Lesson 11-2 Nets and Surface Area.
OpenGL Conclusions OpenGL Programming and Reference Guides, other sources CSCI 6360/4360.
CS 480/680 Intro Dr. Frederick C Harris, Jr. Fall 2014.
به نام خدا تنظیم کننده : فرانه حدادی استاد : مهندس زمانیان تابستان 92.
Lecture 6: 3D graphics Concepts 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 718,  ex 2271 
COMPUTER GRAPHICS CSCI 375. What do I need to know?  Familiarity with  Trigonometry  Analytic geometry  Linear algebra  Data structures  OOP.
MIRALab Where Research means Creativity SVG Open 2005 University of Geneva 1 Converting 3D Facial Animation with Gouraud shaded SVG A method.
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.
CS324e - Elements of Graphics and Visualization Java 3D Intro.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Vertices, Edges and Faces By Jordan Diamond. Vertices In geometry, a vertices is a special kind of point which describes the corners or intersections.
Graphics Concepts CS 2302, Fall /17/20142 Drawing in Android.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
In the name of God Computer Graphics.
CS378 - Mobile Computing 3D Graphics.
11/5/2002 (c) University of Wisconsin, CS 559 Last Time Local Shading –Diffuse term –Specular term –All together –OpenGL brief overview.
CS305j Introduction to Computing Simple Graphics 1 Topic 11 Simple Graphics "What makes the situation worse is that the highest level CS course I've ever.
Mobile & Casual Gaming OpenGL ES Intro. /red/chapter03.html.
By: Eliav Menachi.  Android custom 2D graphics library  OpenGL ES 1.0 for high performance 3D graphics.
Computer Graphics (Fall 2003) COMS 4160, Lecture 5: OpenGL 1 Ravi Ramamoorthi Many slides courtesy Greg Humphreys.
Graphics & Animation Radan Ganchev Astea Solutions.
- Introduction - Graphics Pipeline
In the name of God Computer Graphics.
IMAGES.
Introduction to OpenGL
CS451Real-time Rendering Pipeline
Topic 8 graphics "What makes the situation worse is that the highest level CS course I've ever taken is cs4, and quotes from the graphics group startup.
3-D Views of Solid Figures
CS297 Graphics with Java and OpenGL
Introduction to OpenGL
OpenGL-Rendering Pipeline
Presentation transcript:

CS378 - Mobile Computing 3D Graphics

2D Graphics android.graphics library for 2D graphics (not Java AWT and Swing) classes such as Canvas, Drawable, Bitmap, and others to create 2D graphics Various attempts to make two d graphics appear more "lifelike" and 3 dimensional

Gradients Gradient Paints can add depth to 2d primitives Notice the gradient paint on the pegs and shading on numbers

2D Graphics

Parallax Scrolling Example

2.5D Isometric Graphics "rotate" object to reveal details on the side Ultima Online Zaxxon

3D Graphics Create 3D model Model rendered into a 2D projection a small scene or a large world Model rendered into a 2D projection model includes objects (boxes, cones, cylinders, sphere, user defined models) lighting cameras textures dynamic behaviors

3D Coordinate System x and y as expected (positive y is up, not down as in 2d graphics z axis - positive z is out of screen, negative z is into screen y+ z- z+ x+

Visual Portion Portion of 3D Scene that is rendered is contained in a frustum (pro: frəstəm) a pyramid or cone with its top cut off objects in scene, but not visible

OpenGL Developed by Silicon Graphics Inc. developer of high end graphics systems and machines in 80s and 90s Integrated Raster Imaging System Graphics Library 1992 OpenGL maintained by non profit Khronos Group

OpenGL low level, procedural API programmer responsible for defining steps to create and render (show) a scene alternatives use a scene graph where programmer describes scene and actions (behaviors) and library manages the details of rendering it Example of Graphics libraries that use Scene Graphs: Java3D, Acrobat 3D, AutoCAD, CorelDRAW, RenderMan (Pixar)

OpenGL ES ES = Embedded Systems Used in a wide variety of devices, not just Android iPad, iPhone, Blackberry, symbian, Nintendo3DS, Playstation 3, Web GL OpenGL version ES 2.0 API supported in Android 2.2 and higher (API levels 8 and higher) prior versions of Android support ES 1.1 emulator DOES NOT support ES 2.0

Android and OpenGL ES two ways of working with GL: through the framework APIandroid.opengl package via the Android Native Development Kit (NDK) companion tool to Android SDK to build portions of apps in native code in C or C++ Required Android classes for first approach: GLSurfaceView and GLSurfaceView.Renderer

GLSurfaceView Similar to SurfaceView draw and manipulate objects using Open GL API calls to respond to touch screen events subclass GLSurfaceView and implement touch listeners

GLSurfaceView.Renderer An interface Must implement these methods: onSurfaceCreated for actions that only happen once such as initializing GL graphics objects onDrawFrame() work horse method to create movement and animation onSurfacechanged() called when size of view changes or orientation

Manifest Requirements To use OpenGL ES 2.0 (Android 2.0 and later) if app uses texture compression formats must declare which formats application supports <support-gl-texture>

Steps to Use OpenGL Create activity using GLSurfaceView and GLSurfaceView.Renderer Create and draw graphics objects define projection for screen geometry to correct for non square pixels define a camera view perform actions to animate objects make view touch interactive if desired

Sample Program Demonstrate set up of required elements draw and rotate a 3d object (a cube) Create Simple Activity that has a GLSurfaceView as its content view To draw objects must implement GLSurfaceView.Renderer

Activity

GLSurfaceView Shell of class Used to manage surface (special piece of memory), manage EGL display (embedded graphics library, renders on thread decoupled from I thread, and more

Skeleton Renderer

OpenGL Documentation Android Documentation for GL10 list constants and methods but have no other useful information Check the OpenGL ES documentation http://www.khronos.org/opengles/sdk/1.1/docs/man/

Low Level Graphics Libraries "What makes the situation worse is that the highest level CS course I've ever taken is cs4, and quotes from the graphics group startup readme like 'these paths are abstracted as being the result of a topological sort on the graph of ordering dependencies for the entries' make me lose consciousness in my chair and bleed from the nose." -mgrimes, Graphics problem report 134

Draw a Shape Draw a simple, flat Triangle using OpenGL (X,Y,Z) coordinate system (0, 0, 0) center of frame (1, 1, 0) is top right corner of frame (-1, -1, 0) is bottom left corner of frame must define vertices of our triangle

Define Triangle -1 0 1 1 0 -1

Draw Triangle init OpenGL to use vertex arrays call drawing API to draw triangle

Result oooo, ahhhh Graphics coordinate system assumes a square but mapped to a rectangular frame

Correcting Projection Apply an OpenGL projection view and camera (eye point) to transform coordinates of the triangle "correct" the position onSurfaceChanged and onDrawframe()

onSurfaceChanged

onDrawFrame

Result of Correcting Projection

Adding Motion in onDrawFrame define vector of rotation

Results X Axis (angle, 1, 0, 0) Y Axis (angle, 0, 1, 0)

Results Z Axis (angle, 0, 0, 1) Y Axis (angle, -1, 1, -1)

Another Example Draw a pyramid that bounces around the screen Same basic steps as previous apps Activity with GLSurfaceView Implementation of GLSurfaceView.Renderer Pyramid class that defines the geometry and appearance of 3d pyramid object

Constructing Pyramid specify vertices for 6 triangles 4 sides, 2 triangles for the base 1 (-1, 1, -1) 2 (1, 1, -1) 4 (0, 0, 1) imagine it out of screen 0 (-1, -1, -1) 3 (1, -1, -1)

Constructing Pyramid Indices refers to set or coordinate (x, y, z)

Coloring Pyramid Define colors for each of the 5 vertices Colors blend from one vertex to another recall, rgba

Result

OpenGL Options Renderscript OpenGLUT, OpenGL Utility Toolkit high performance, but low level scripts written in C OpenGLUT, OpenGL Utility Toolkit not officially part of Android, Android GLUT Wrapper include more geometric primitives