CSE 410 Computer Graphics Sessional

37
CSE 410 Computer Graphics Sessional INTRODUCTION

description

CSE 410 Computer Graphics Sessional. INTRODUCTION. What is COMPUTER GRAPHICS?. Painting with numbers!. Aspects. Modeling Rendering Animation. Aspects. Visualization Virtual Reality Image Processing User interaction / Human Computer Interface 3D Scanning. Applicability?. - PowerPoint PPT Presentation

Transcript of CSE 410 Computer Graphics Sessional

Slide 1

CSE 410 Computer Graphics SessionalINTRODUCTIONWhat is COMPUTER GRAPHICS?Painting with numbers!Aspects Modeling Rendering AnimationAspectsVisualizationVirtual RealityImage ProcessingUser interaction / Human Computer Interface3D Scanning

Applicability?

Animation movie : Kung Fu Panda6

Games: Farcry 27

Special Effect : 3008

Visualization : Winamp9

CAD/CAM : 3dsMaxRender : Saiful Hasan Tariq , Arch 0210

Medical Imaging11Extent of CGWhat are we going to learn?Extent of CGHow CG systems work.How to model of real life objects.How to render modeled objects.How to make things more realistic.How to make things more beautiful.Extent of CSE410Extent of CSE410Understanding of Graphics API : OpenGLUnderstand how to use 3D APIs to create games, animations, renders or visualization.Learn how APIs work from inside.CG BasicsRepresentationPoints

Lines

Polygon

Mesh

You can model anything by using 3D mesh.18Textures , shaders , post processing and other techniques like radiocity and raytracing are used to produce realistic rendering of modeled objects.RenderingHow can we show the objects on the screen from the mathematical data of the models we have?2D Hypothetical WorldA canvasInfinitely extended drawing area having two perpendicular axes ( x and y )

A viewporta finite 2d rectangular are ( lets say it is 8x6 pixels ) that represents what is shown on the screen.Lets assume we have the following things true for our fantasy world of rendering.CANVASVIEWPORTThe viewport controls what portion of the canvas is seen on the screen. Its kind of like a camera viewfinder.23We can do following drawing on the canvas.drawPointdrawRectangle (width , height )drawPictureAnd the following commands to place our desired drawing on the desired part of the canvas.Translate ( x , y )Rotate ( x )

These commands effects any drawing done after calling them.Sample drawings and outputspoint().

Sample drawings and outputstranslate(3,2)drawPoint().

Now lets say we want to draw the following picture.Translate ( -10 , -5)Rotate ( -45 )drawRectangle ( 10 , 5 )and also dont forget the need of a camera.

Camera (-4,-3)

Now.. how does our graphics card calculate where to draw the pixels when it receives such coordinates for drawing from our program?Sample again

camera ( 0 , 0 )translate ( 3,-1) point()Canvas coordinate (3,-1)Screen coordinate (3,1)Sample again

camera ( -2 , 1 )translate ( 3,-1) point()Canvas coordinate (3,-1)Screen coordinate ? ( 5 , 2 )x = 0 + 3 (-2) = 5y = 0 (-1) + 1 = 2point()

translate ( 3,-1)camera ( -2 , 1 )Calculation for x axisCommands0 + 3 - ( -2) Now we can make an equation !

Final coordinate on the screen

=

Actual coordinate+Transformation-Camera Position}Gives us coordinate on the canvas}Gives us coordinate on the screenModeling TransformationViewing TransformationThis process of calculating final output picture from initial coordinates/models in a step by step manner is known as

Graphics Pipeline With understanding of the hypothetical world now lets get real,

How does our actual graphics systems work?How 3D objects are rendered on the screen?What more is there in the 3D pipeline?

Lets explore!