Presentations.


93 views
Uploaded on:
Description
Presentations. Brad Grantham speaker lab man Dave Shreiner teacher slave driver. Course Objectives. Create self evident aptitudes in PC Representation using the vital arithmetic Exhibit a comprehension of the required programming ideas we'll be utilizing C/C++
Transcripts
Slide 2

Introductions Brad Grantham instructor lab buddy Dave Shreiner speaker slave driver COEN 290 - Computer Graphics I

Slide 3

Course Goals Develop obvious aptitudes in Computer Graphics using the essential arithmetic Demonstrate a comprehension of the obliged programming ideas we’ll be utilizing C/C++ Have fun doing cool stuff COEN 290 - Computer Graphics I

Slide 4

Syllabus Grading programming labs midterm last homework class cooperation COEN 290 - Computer Graphics I

Slide 5

Course Texts Required Interactive Computer Graphics - A top-down methodology utilizing OpenGL (2 nd Edition) by Edward Angel Recommended The OpenGL Programming Guide (3 rd Edition) by Mason Woo, Jackie Neider, Tom Davis, Dave Shreiner COEN 290 - Computer Graphics I

Slide 6

Finding Course Information Web Site http://plunk.org/COEN-290 one-quit looking for data Email Alias coen290@plunk.org utilize this for most correspondence email {grantham,shreiner}@plunk.org for individual issues COEN 290 - Computer Graphics I

Slide 7

Your First Assignment Send an email to the class moniker with your favored email address(es) coen290@plunk.org COEN 290 - Computer Graphics I

Slide 8

Evening’s Goals Introduce a considerable lot of the ideas that we’ll be examining over the quarter Describe the procedure of 3D displaying Provide an outline of the rendering library we’ll be utilizing Set up you for your first task COEN 290 - Computer Graphics I

Slide 9

Motivation for Learning Graphics Entertainment Training and Simulation Art Publications Scientific Visualization Computer Aided Design/Engineering COEN 290 - Computer Graphics I

Slide 10

The Essence of Computer Graphics “Figuring out what hues to make those specks on the screen” - me COEN 290 - Computer Graphics I

Slide 11

The Trade\'s Tools Rendering Primitives Mathematical Transformations Graphical Techniques recreating lighting surface mapping shading models COEN 290 - Computer Graphics I

Slide 12

Rendering Primitives Geometric primitives focuses lines polygons Image primitives COEN 290 - Computer Graphics I

Slide 13

Mathematical Transformations Use changes for moving starting with one direction space then onto the next The uplifting news just obliges duplication and expansion The terrible news its increase and expansion of networks COEN 290 - Computer Graphics I

Slide 14

Mathematical Transformations ( cont. ) Coordinate spaces we’ll be utilizing model world eye standardized gadget ( NDC’s ) window screen viewport COEN 290 - Computer Graphics I

Slide 15

(0,10) Pixel situated at (4,2) (0,5) (0,0) (10,0) (5,0) Screen Space Addressable space of your showcase gadget 2 dimensional space Most regularly measured in pixels whole number tending to COEN 290 - Computer Graphics I

Slide 16

Framebuffers Computer memory for putting away screen space pixels locations changed over into memory addresses Pixels can contain distinctive sorts of data shading profundity COEN 290 - Computer Graphics I

Slide 17

Framebuffer Size Usually measured in bitplanes additionally alluded to as bits per pixel “Deeper” the pixels, the more data they can hold COEN 290 - Computer Graphics I

Slide 18

Window Coordinates Addressable space of your window subset of screen space 2D space measured in pixels controlled by your windowing framework COEN 290 - Computer Graphics I

Slide 19

(0,10) (0,5) (0,0) (10,0) (5,0) Rasterization Process of changing over primitives into pixels subject of a future class From this ... To this ... COEN 290 - Computer Graphics I

Slide 20

What we’ll be utilizing as our Toolbox Some home-moved stuff OpenGL industry standard design library accessible on every registering stage Unix, Linux, Macintosh, Microsoft Windows GLUT compact OpenGL windowing library firmly incorporated with OpenGL COEN 290 - Computer Graphics I

Slide 21

OpenGL Application Programming Interface ( API ) straightforward procedural interface more than 400 calls Immediate satisfaction see what you draw instantly likewise executes “retained” mode Not photograph reasonable implied for intuitive applications COEN 290 - Computer Graphics I

Slide 22

Application Transform Rasterization Framebuffer Graphics Pipeline OpenGL’s Rendering Pipeline OpenGL actualizes a rendering pipeline rendering is the name for the whole process COEN 290 - Computer Graphics I

Slide 23

Quick Introduction to OpenGL Commands OpenGL and related libraries “Core” OpenGL gl OpenGL Utility Library glu OpenGL Utility Toolkit excess GLU charges actualized in center GL GLUT is a freeware library abstracts away managing a particular window framework COEN 290 - Computer Graphics I

Slide 24

Preliminaries Header documents #include <GL/gl.h> #include <GL/glu.h> #include <GL/glut.h> Link with illustrations libraries cc prog.c - lglut - lGLU - lGL - lX11 - lXmu - o prog cl proc.c glut32.lib glu32.lib opengl32.lib \ gdi32.lib user32.lib GL listed sorts for stage autonomy GLbyte, GLshort, GLushort, GLint, GLuint, GLsizei, GLfloat, GLdouble, GLclampf, GLclampd, GLubyte, GLboolean, GLenum, GLbitfield

Slide 25

glVertex3fv( ... ) Data Type Vector Number of segments b - byte ub - unsigned byte s - short us - unsigned short i - int ui - unsigned int f - coast d - twofold preclude “v” for scalar structure glVertex2f( x, y ) 2 - (x,y) 3 - (x,y,z) 4 - (x,y,z,w) OpenGL Command Syntax COEN 290 - Computer Graphics I

Slide 26

OpenGL Geometric Primitives All geometric primitives are determined by their vertices GL_POINTS GL_POLYGON GL_LINE_LOOP GL_LINE_STRIP GL_LINES GL_TRIANGLES GL_QUADS GL_TRIANGLE_FAN GL_TRIANGLE_STRIP GL_QUAD_STRIP COEN 290 - Computer Graphics I

Slide 27

Specifying Primitives are depicted by their vertices Vertex is a point in space which is utilized as a part of the development of a geometric primitive Described by a homogenous direction COEN 290 - Computer Graphics I

Slide 28

Modeling Process of sorting out vertices into primitives arranging primitives into articles arranging items into a scene 6 4 2 5 3 1 COEN 290 - Computer Graphics I

Slide 29

Specifying an OpenGL Vertex Recall OpenGL indicates geometric primitives by its vertices glVertex3f ( x, y, z ); Different primitives oblige distinctive quantities of vertices COEN 290 - Computer Graphics I

Slide 30

Actually Drawing Something ... Here’s an OpenGL grouping to draw a square based on the inception glBegin( GL_QUADS ); glVertex2f( - 0.8, - 0.8 ); glVertex2f( 0.8, - 0.8 ); glVertex2f( 0.8, 0.8 ); glVertex2f( - 0.8, 0.8 ); glEnd(); COEN 290 - Computer Graphics I

Slide 31

Adding Personality to Primitives State ( or Attributes ) information needed for figuring hues for primitives Examples shading reflectivity surface composition COEN 290 - Computer Graphics I

Slide 32

Specifying a Vertex’s Color Use the OpenGL shading charge glColor3f ( r, g, b ); Where you indicate the shading decides how the primitive is shaded focuses just get one shading COEN 290 - Computer Graphics I

Slide 33

Flat Shading in OpenGL If you issue one and only glColor() order per primitive glColor3f ( r, g, b ); glBegin ( GL_TRIANGLES ); glVertex3fv ( v1 ); glVertex3fv ( v2 ); glVertex3fv ( v3 ); glEnd (); COEN 290 - Computer Graphics I

Slide 34

Gouraud Shading in OpenGL However, to get Gouraud, issue a shading for each vertex glBegin ( GL_TRIANGLES ); glColor3fv ( c1 ); glVertex3fv ( v1 ); glColor3fv ( c2 ); glVertex3fv ( v2 ); glColor3fv ( c3 ); glVertex3fv ( v3 ); glEnd (); COEN 290 - Computer Graphics I

Slide 35

Hacking Graphics Code Basics ventures in going a representation project open a window with legitimate traits clear the window change properties render stuff goto  as essential COEN 290 - Computer Graphics I

Slide 36

Opening a Window Using GLUT void primary( int argc, char** argv ) { glutInitWindowSize( 512, 512 ); glutInitDisplayMode( GLUT_RGBA ); glutCreateWindow( “my window” ); init(); glutDisplayFunc( drawScene ); glutMainLoop(); } COEN 290 - Computer Graphics I

Slide 37

OpenGL Initalization We’ll utilize the init() routine for our one-time OpenGL state introduction call after window has been made, yet before first rendering call void init( void ) { glClearColor( 1.0, 0.0, 0.0, 1.0 ); } COEN 290 - Computer Graphics I

Slide 38

Rendering a Scene void drawScene( void ) { glClear( GL_COLOR_BUFFER_BIT ); glColor3f( 1, 1, 1 ); glRectf( - 0.9, - 0.9, 0.9, 0.9 ); glFlush(); } COEN 290 - Computer Graphics I

Slide 39

More of your First Assignment Do what

Recommended
View more...