Introduction To Computer Graphics COMPSCI 464

8m ago
20 Views
1 Downloads
1.81 MB
50 Pages
Last View : 1m ago
Last Download : 7m ago
Upload by : Jayda Dunning
Transcription

Introduction to Computer GraphicsCOMPSCI 464Image credits: Pixar, Dreamworks, Ravi Ramamoorthi,

This class This class is not about– Using multiple graphicsAPI’s– Using modelingsoftware such as Mayaetc– Animation and creatingmovies– Game design anddevelopment It is about– Learning thefundamentals ofcomputer graphics– Implementingalgorithms that are atthe core of computergraphics– Familiarizing yourselfwith OpenGL andshaders

What is Computer Graphics? Making pictures with computers? Making pictures with math? Making pictures with physics?

Where did this image come from? What hardware/software did we need toproduce it?Angel and Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012

Preliminary Answer Application: The object is an artist’s renditionof the sun for an animation to be shown in adomed environment (planetarium) Software: Maya for modeling and renderingbut Maya is built on top of OpenGL Hardware: PC with graphics card formodeling and renderingAngel and Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012

Computer Graphics: 1950-1960 Computer graphics goes back to theearliest days of computing– Strip charts– Pen plotters– Simple displays using A/D converters to gofrom computer to calligraphic CRT Cost of refresh for CRT too high– Computers slow, expensive, unreliableAngel and Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012

Computer Graphics: 1960-1970 Wireframe graphics– Draw only lines Sketchpad Display Processors Storage tubewireframe representationof sun objectAngel and Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012

Computer Graphics: 1970-1980 Raster Graphics Beginning of graphics standards Workstations and PCsAngel and Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012

Raster Graphics Image produced as an array (the raster) ofpicture elements (pixels) in the frame bufferAngel and Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012

Raster Graphics Allows us to go from lines and wireframe images to filled polygonsAngel and Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012

Computer Graphics: 1980-1990Realism comes to computer graphicssmooth shadingenvironmentmappingAngel and Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012bump mapping

Computer Graphics: 1980-1990 Special purpose hardware– Silicon Graphics geometry engine VLSI implementation of graphics pipeline Industry-based standards– PHIGS– RenderMan Networked graphics: X Window System Human-Computer Interface (HCI)Angel and Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012

Computer Graphics: 1990-2000 OpenGL API Completely computer-generatedfeature-length movies (Toy Story) aresuccessful New hardware capabilities– Texture mapping– Blending– Accumulation, stencil buffersAngel and Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012

Computer Graphics: 2000 Photorealism Graphics cards for PCs dominate market– Nvidia, ATI/AMD, Intel Game boxes and game players determinedirection of market Computer graphics routine in movieindustry: Maya, Lightwave, etc Programmable pipelinesAngel and Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012

Real-time vs. Offline Real-time/interactive– 10–60 frames persecond– Games, interfaces,visual simulation. Offline/production– Seconds to hours perframe– Movies, architecturallighting simulation, .

Realistic Rendering Realistic/Photorealistic– Look like real life– Simulate physics– Reasonable appearing approximationNorbert Kern – POV-Ray Hall of Fame Gallery

Artistic/Non-PhotoRealistic Look like what an artist might produce Model artist’s process, physics Do what looks right (an art in itself)

Artistic

SIGGRAPH 2011 Technical Papers:http://www.youtube.com/watch?v JK9EEE3RsKM

Course Information Course Webpage:http://cs.boisestate.edu/ alark/cs464/ Place: MEC 309 Time: Mon Wed 6:00-7:15pm Prerequisites– COMPSCI 342 (Data Structures)

People Instructor: Alark JoshiEmail: alark@cs.boisestate.eduOffice hours: Tu, Th 3-5pm or byappointment Office: MEC 302A Piazza instead of a mailing list– http://www.piazza.com/boisestate/compsci464

Textbooks Fundamentals of ComputerGraphics.Peter Shirley and othersThird Edition, AK Peters, 2009.Required. OpenGL Programming GuideMason Woo and othersAddison Wesley, 2009.Required.– Older versions online

Course Objectives Understand the foundations ofcomputer graphics: hardware systems,math basis, light and color.

Course Objectives Implement key components of the renderingpipeline, especially visibility, rasterization,viewing, and shading.

Course Objectives Become acquainted with topics in computergraphics such as:– Texturing– Animation– Physically-based modeling– Procedural modeling– Curves and surfaces– Game development issues– Visualization– Virtual realityImage credits: Kitware, Ravi Ramamoorthi et al.

Grading Policy and AssignmentsProgramming Assignments50%Midterm Exam15%Quizzes10%Final Project25%AssignmentWeightDescriptionDue DateAssn 110%Introduction to OpenGLAug 31Assn 210%ModelingSep 12Assn 310%Transformations & ViewingSep 26Assn 410%ShadersOct 17Assn 510%Lighting, Shading and TextureMappingNov 7

Grading Policy One free late ofthree days– Request at least 24hours beforedeadline

Final Project (25%) Ray Tracing Processing WebGL / OpenGL onAndroid / OpenGL ES openFrameworks Cloth simulation /Deformation Volume rendering

Final Project (25%) Non-photorealistic rendering(painterly, artistic styles, etc.) Graphical application using CUDA(cloth simulation, mass springmodel, etc) Advanced shader projects (smoke,water, etc) Something exciting that you canconvince me about (look atSIGGRAPH papers) or come talk tome

Final Projects 2 Person project Requires– Project proposal (1 – page)– Project status (1 – page)– Project Report ( 8 – pages )– User manual ( 1-2 pages)– Source code– In-class presentation

Questions? Concerns?

Introducing OpenGL OpenGL – Open Graphics Library The rendering pipeline:–––––Transform geometry (object world eye)Calculate surface lightingApply perspective projection (eye screen)Clip to the view frustumPerform visible-surface processing Implementing all this is a lot of work OpenGL provides a standard implementation

OpenGL Design Goals SGI’s design goals for OpenGL– High-performance (hardware-accelerated) graphicsAPI– Some hardware independence– Natural, terse API with some built-in extensibility

OpenGL Design Goals OpenGL has become a standard because– It doesn’t try to do too much Only renders the image, doesn’t manage windows,etc. No high-level animation, modeling, sound (!), etc.– It does enough Useful rendering effects high performance– It was promoted by SGI (& Microsoft, half-heartedly),is now promoted/supported by NVIDIA, ATI/AMD,Apple etc. It doesn’t change every year (likeDirectX/Direct3D, it’s main competitor)

OpenGL: Conventions Functions in OpenGL start with gl– Most functions just gl (e.g., glColor())– Functions starting with glu are utility functions(e.g., gluLookAt()) Note that GLU functions can always be composedentirely from core GL functions– Functions starting with glut are from the GLUT(OpenGL Utility Toolkit) library, built on top ofOpenGL and WGL (Windows) or X (Linux) forwindow management, mouse and keyboard events, etc. Created and distributed as an entirely different library

OpenGL: ConventionsAngel and Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012

OpenGL: Conventions Function names indicate argument type andnumber–––––Functions ending with f take floatsFunctions ending with i take intsFunctions ending with b take bytesFunctions ending with ub take unsigned bytesFunctions that end with v take an array. Examples– glColor3f() takes 3 floats– glColor4fv() takes an array of 4 floats

Program Structure Most OpenGL programs have a similarstructure that consists of the followingfunctions– main(): defines the callback functions opens one or more windows with the required properties enters event loop (last executable statement)– init(): sets the state variables Viewing Attributes– callbacks Display function (called display() in many example programs) Input and window functionsAngel and Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012

OpenGL – Hello World/** hello.c* This is a simple, introductory OpenGL program.*/#include GL/glut.h void display(void){/* clear all pixels */glClear (GL COLOR BUFFER BIT);/* draw white polygon (rectangle) with corners at* (0.25, 0.25, 0.0) and (0.75, 0.75, 0.0)*/glColor3f (1.0, 1.0, 1.0);glBegin(GL POLYGON);glVertex3f (0.25, 0.25, 0.0);glVertex3f (0.75, 0.25, 0.0);glVertex3f (0.75, 0.75, 0.0);glVertex3f (0.25, 0.75, 0.0);glEnd();

OpenGL – Hello World/** start processing buffered OpenGL routines*/glFlush ();}void init (void){/* select clearing color */glClearColor (0.0, 0.0, 0.0, 0.0);/* initialize viewing values */glMatrixMode(GL PROJECTION);glLoadIdentity();glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);}

OpenGL – Hello World/** Declare initial window size, position, and display mode* (single buffer and RGBA). Open window with "hello"* in its title bar. Call initialization routines.* Register callback function to display graphics.* Enter main loop and process events.*/int main(int argc, char** argv){glutInit(&argc, argv);glutInitDisplayMode (GLUT SINGLE GLUT RGB);glutInitWindowSize (250, 250);glutInitWindowPosition (100, 100);glutCreateWindow ("hello");init ();glutDisplayFunc(display);glutMainLoop();return 0;/* ANSI C requires main to return int. */}

OpenGL Hello World

GLUT functions glutInit allows application to get command linearguments and initializes system gluInitDisplayMode requests properties for thewindow (the rendering context)– RGB color– Single buffering– Properties logically ORed together glutWindowSize in pixelsglutWindowPosition from top-left corner of displayglutCreateWindow create window with title “simple”glutDisplayFunc display callbackglutMainLoop enter infinite event loopAngel and Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012

OpenGL Rotating Square/** double.c* This is a simple double buffered program.* Pressing the left mouse button rotates the rectangle.* Pressing the middle mouse button stops the rotation.*/#include GL/glut.h #include stdlib.h static GLfloat spin 0.0;void display(void){glClear(GL COLOR BUFFER BIT);glPushMatrix();glRotatef(spin, 0.0, 0.0, 1.0);glColor3f(1.0, 1.0, 1.0);glRectf(-25.0, -25.0, 25.0, 25.0);glPopMatrix();glutSwapBuffers();}

OpenGL Rotating Squarevoid spinDisplay(void){spin spin 2.0;if (spin 360.0)spin spin - 360.0;glutPostRedisplay();}void init(void){glClearColor (0.0, 0.0, 0.0, 0.0);glShadeModel (GL FLAT);}void reshape(int w, int h){glViewport (0, 0, (GLsizei) w, (GLsizei) h);glMatrixMode(GL PROJECTION);glLoadIdentity();glOrtho(-50.0, 50.0, -50.0, 50.0, -1.0, 1.0);glMatrixMode(GL MODELVIEW);glLoadIdentity();}

OpenGL Rotating Squarevoid mouse(int button, int state, int x, int y){switch (button) {case GLUT LEFT BUTTON:if (state GLUT DOWN)glutIdleFunc(spinDisplay);break;case GLUT MIDDLE BUTTON:case GLUT RIGHT BUTTON:if (state GLUT DOWN)glutIdleFunc(NULL);break;default:break;}}

OpenGL Rotating Square/** Request double buffer display mode.* Register mouse input callback functions*/int main(int argc, char** argv){glutInit(&argc, argv);glutInitDisplayMode (GLUT DOUBLE GLUT RGB);glutInitWindowSize (250, 250);glutInitWindowPosition (100, 100);glutCreateWindow (argv[0]);init e);glutMouseFunc(mouse);glutMainLoop();return 0;/* ANSI C requires main to return int. */}

OpenGL Rotating Square Demo

Reading Reading assignments on class webpage– Reading must be done before class– Excellent supplement to in-class material Assignment 1: Introduction to OpenGLis due on August 31st at 11:59pm

Trivia Which was the first ever computergraphics video game?

Introduction to Computer Graphics COMPSCI 464 Image credits: Pixar, Dreamworks, Ravi Ramamoorthi, . –Game design and development It is about –Learning the fundamentals of computer graphics –Implementing algorithms that are at the core of computer graphics . Fundamentals of Computer Graphics

Related Documents:

2/25/2021 Compsci 101, Spring 2021 10 Compsci 101 Pancakes, While loops, Parallel Lists Part 2 of 3 2/25/2021 Compsci 101, Spring 2021 11 Susan Rodger Nikki Washington February 25, 2021 while BOOL_CONDITION: LOOP_BODY # modify variables, affect expression Collatz Code 2/25/2021 Compsci 101, Spring 2021 12

Computer Graphics & Image Processing 2003 Neil A. Dodgson 2 7 Course books Computer Graphics: Principles & Practice Foley, van Dam, Feiner & Hughes,Addison-Wesley, 1990 zOlder version: Fundamentals of Interactive Computer Graphics Foley & van Dam, Addison-Wesley, 1982 Computer Graphics &

D. Salomon: Computer Graphics Geometric Modeling, Springer, 1999 A. Watt: 3D Computer Graphics. Addison-Wesley Publishing Company, Inc., 2000 Journals Computer Graphics Forum IEEE CG & Applications ACM Transactions on Graphics ACM Transaction

Graphics Courses Key course Image processing and computer graphics (modeling, rendering, simulation) Specialization courses Advanced computer graphics (global illumination) Simulation in computer graphics (deformable and rigid solids, fluids) Master project, lab course, Master thesis Simulation track, rendering track

Interactive graphics is useful in a. Training pilots b. Computer aided design c. Process control d. All of these 57. The origin of computer graphics was developed in a. 1950 b. 1960 c. 1970 d. 1990 58. The term business graphics came into use in late a. 1950 b. 1960 c. 1970 d. 1990 59. Computer graphics is used in many DTP software as a .

COMPUTER GRAPHICS & VISUALIZATION - 15CS62 Module -1 1. a. Enlist the applications of computer graphics and explain. (6 marks). i. Graphs and charts Display of simple data graphs was the early application of computer graphics plotted on a character printer. Data plotting one of the most common graphics applications

An Introduction to R Graphics 3 This example is basic R graphics in a nutshell. In order to produce graphical output, the user calls a series of graphics functions, each of which produces either a complete plot, or adds some output to an existing plot. R graphics follows a\painters model,"which means that graphics output occurs in steps,

Computer Graphics 6 Computer graphics is an art of drawing pictures on computer screens with the help of programming. It involves computations, creation, and manipulation of data. In other words, we can say that computer graphics is a rendering tool for the generation and manipulation of images. Cathode Ray Tube

development for computer graphics. Olin holds a Master of Engineering in Electrical Engineering from Rensselaer Polytechnic Institute. Olin has also worked at Hewlett-Packard, Raster Technologies, and Apollo Computer, where he specialized in graphics hardware design. Olin is the author of the introductory book The Way Computer Graphics Works.

– 3D Computer Graphics (Watt) – 3D Computer Graphics: A Mathematical Introduction with OpenGL (Buss) There is a free online version. available from Books24x7 – Real-Time Rendering, 3rd ed. (Akenine-Möller, Haines, Hoffman) – Fundamentals of Computer Graphics, 3rd

What is computer Graphics? Computer graphics is an art of drawing pictures, lines, charts, etc. using computers with the help of programming. Computer graphics image is made up of number of pixels. Pixel is the smallest addressable graphical unit represented on the computer screen. Introduction Computer is information processing machine.

How the Dictionary is made Using a dictionary is reasonably straight -forward We will be clients, not implementers Efficiency not a large concern in 101 Our goal is to just get stuff done 10/8/2020 Compsci 101, Fall 2020 4 This Photo by Unknown Author is licensed under CC B

LastTryat RemoveAll Use java.util.Iterator, lists have one Unfortunately, some operations are “optional” Idiom similar to Scanner, why? Interface! 10/20/17 Compsci 201, Fall 2017, Linked Lists &

COMPSCI 501: Formal Language Theory I Instructor : Marius Minea, o ce hous: Tue 3-4 pm, LGRC A261 . Inductive step : Assume true for n 1, prove for n 1 . Remove horse x from set of n 1 horses. Remaining set has n horses, all of same color. Now add back x and remove a di erent horse y. Again n horses, all

Evolution of ODS Graphics Early Development of SAS Graphics In the beginning SAS had a less than stellar reputation regarding graphics output. PROC PLOT produced crude raster graphics using a line printer. Then there was SAS/GRAPH and visuals became better. Vector graphics used to produce quality output. Lots of options but too many to learn well (difficult to use “on the fly”).

Interactive graphics rggobi (GGobi) Link iplots Link Open GL (rgl) Link Graphics and Data Visualization in R Overview Slide 5/121. . Graphics and Data Visualization in R Graphics Environments Base Graphics Slide 16/121. Line Plot: Single Data Set plot(y[,1], type "l", lwd 2, col "blue") 2 4 6 8 10 0.2 0.4 0.6 0.8 Index

Overview of Computer Graphics 1.1 Application of Computer Graphics Computer-Aided Design for engineering and architectural systems etc. Objects maybe displayed in a wireframe outline form. Multi-window environment is also favored for producing various zooming scales and views. Animations are useful for testing performance. Presentation Graphics

Computer Graphics: Principles and Practice in C. Foley, van Dam, Feiner, and Hughes » Computer Graphics, C Version. Hearn and Baker » OpenGL Programming Guide: The Official Guide to Learning OpenGL. Neider, Davis, and Woo » Fundamentals of Computer Graphics

Computer Graphics Introduction Week 1, Lecture 1 David Breen, William Regli and Maxim Peysakhov Department of Computer Science Drexel University. 2 Overview Course Policies/Issues Brief History of Computer Graphics The Field of Computer Graphics: A view from 66,000ft

2.1.6 Adding NDK Hooks Using ACD Support . It is not intended as an API reference. How to Use This Manual The information presented in this document is divided into the following chapters: Chapter 1: Overview introduces the stack and developing network applications. Chapter 2: Network Application Development describes the NDK software, and how to start developing network applications .