Windows & DirectX Programming #1
Kang, Seong-tae Computer Graphics, 2009 Spring
CGLab
Contents
Basic Windows Programming Windows GDI Preparing for DirectX Programming
CGLab
Prerequisites
Windows 2000/XP or later Microsoft Visual Studio
Development tool
Computer Graphics Assignment #1
Drawing Lines and Polygons
n Input file Number of vertices Vertex information Index Position : x, y (0~500)
Number of polygons Polygon information Index Number of vertices Indices of vertices (counter clockwise)
vertex inde
Computer Graphics Assignment #2
3D Viewing
n What to do You should show the process that makes each matrix World, viewing, projection, viewport Projection is parallel or perspective
n
Mesh Input file (.msh) Number of vertices Vertex information Index Posi
Curves and Surfaces
Chap. 8 Intro. to Computer Graphics, Spring 2009, Y. G. Shin
Representation of Curves and Surfaces
Key words
surface modeling parametric surface continuity, control points basis functions Bezier curve B-spline curve
Why we need surfa
DirectX Programming ect og a g #1
Kang, Seongtae Computer Graphics, 2009 Spring
Contents
Installation and Settings Introduction to Direct3D 9 Graphics Initializing Direct3D g Rendering Vertices
Installation
DirectX SDK
You can download from Microsoft's ho
DirectX Programming #2
Kang, Seongtae Computer Graphics, 2009 Spring
Contents
The D3D coordinate system Transformation and matrix manipulation Material and Lighting
The D3D Coordinate System
Left-handed
Right-handed coordinate is also available Take c
DirectX Programming #3
Kang, Seongtae Computer Graphics, 2009 Spring
Texture
In real world, only few surfaces have uniform color
How to describe non-uniform surface Divide a surface into numerous sub-surfaces Too complicated!
Tesselation
Texture
Textu
DirectX Programming #5
Kang, Seongtae Computer Graphics, 2009 Spring
The Sample Program
A blue cylinder with white specular color Gouraud shading with one spotlight
Primitives
const int CIRCLE_DIVISION = 50; const int PILLAR_DIVISION = 50;
User Interf
( )
2008. 6. 5
1. What effects are lost in Phong illumination when the light source and the viewer infinitely far away from the scene? 2. Discuss two effects that are missed by Phong illumination and interpolation that are captured by ray-tracing. 3. Des
( )
2008. 4. 24
1. 2.
Discuss pros and cons of raster graphics compared with vector graphics. [5pt] Frame buffers are described as having a certain depth. What does the depth refer? What is stored in the frame buffer when a color map lookup table is used
Modeling
Chapter 8 Intro. to Computer Graphics Spring 2009, Y. G. Shin
Components for Image Synthesis
Scene description Light source Viewpoint Scene = an assembly of one or more models A model contains structural description - geometry of the shape surfa
Graphics Primitives
Chapter 3 & 4 Intro. to Computer Graphics p p Spring 2008, Y.G. Shin
Graphic Output and Input Pipeline
Scan conversion
converts primitives such as lines circles etc lines, circles, etc. into pixel values geometric description a finite
Illumination and Shading
Chapter 10 Intro. to Computer Graphics Spring 2009, Y. G. Shin
Illumination and Shading
Given: scene specification (object positions, optical properties of the surface, viewer position, viewing direction, .) Find: intensity for ea
Antialiasing A ti li i
Chapter 4 Ch Intro. to Computer Graphics Spring 2009 Y.G. Shin 2009, Y G
A Simple Image Model Si l I M d l
Image: a 2-D lightintensity function f(x y) f(x,y) The value of f at (x,y) the intensity (brightness) of the image at that po
Color and Color Model
Chap. 12
Color Visibility
n
Interpretation of color is a psychophysiology problem
We could not fully understand the mechanism Physical characteristics of color can be represented by a formal expression presentation by experimental r
VisibleVisible-Surface Detection Methods
Chapter 9
The Visibility Problem
[Problem Statement]
GIVEN: a set of 3-D surfaces, a projection from 3-D to 2-D screen, DETERMINE: the nearest surface encountered at any point on 2-D screen
n
Remove of hidden parts
Graphics (Output) Primitives
Chapters 3 & 4
Graphic Output and Input Pipeline
n
Scan conversion
n
n
converts primitives such as lines, circles, etc. into pixel values geometric description a finite scene area the process of determining the portion of a pr
2D G Geometric ti Transformations T f ti
Chapter 5 Intro. Intro to Computer Graphics Spring 2009, Y. G. Shin
Introduction
We d l l t W deal a lots with objects defined in 2-D and 3-D ith bj t d fi d i 2 D d 3 D worlds in computer graphics All objects have
Two-Dimensional Viewing
Chapter 6 Intro. to Computer Graphics Spring 2009, Y. G. Shin
Viewing Pipeline
Two-Dimensional Viewing
Two dimensional viewing transformation
From world coordinate scene description to device (screen) coordinates
Normalization and
Geometric Transformations
Chapter 5
Introduction
n
n
We deal a lots with objects defined in 2-D and 3-D worlds in computer graphics All objects have shape, position and orientation
geometric description
n
Geometric transformation
n
Operations that are ap
3D Geometric Transformations
Chapter 5 Intro. to Computer Graphics Spring 2009, Y. G. Shin
3D Transformation
Right-handed coordinate system
y
x
x' x1 y ' y 1 z ' z1 h 0
x2 y2 z2 0
x3 y3 z3 0
tx x t y y tz z 1 1
z
3D Transformation
Translation Scaling
1
Three-Dimensional Th Di i l Viewing Vi i
Chap 7, 2009 Spring Yeong Gil Shin
Viewing Pi li Vi i Pipeline
How to d fi a window? H define i d ? How to project onto the window?
Rendering R d i
"Create a picture (in a synthetic camera)"
Specification of projec
Two-Dimensional Viewing
Chapter 6
Viewing Pipeline
TwoTwo-Dimensional Viewing
n
Two dimensional viewing transformation
n
From world coordinate scene description to device (screen) coordinates
Normalization and Viewport Transformation
n n n
World coordinat
ThreeThree-Dimensional Viewing
Chapter 7
Viewing Pipeline
How to define a window? How to project onto the window?
Rendering
"Create a picture (in a synthetic camera)"
n n
Specification of projection type Specification of viewing parameters
n
viewer's eye,
DirectX Programming #1
Hyunna Lee Computer Graphics, 2010 Spring
Contents
Installation and Settings Introduction to Direct3D 9 Graphics Initializing Direct3D Rendering Vertices The D3D coordinate system Transformation and matrix manipulation
Install
3D Object Representations
Chapter 8
Components for Image Synthesis
Scene description Light source Viewpoint Scene = an assembly of one or more models A model contains structural description - geometry of the shape surface description - appearance (lighti
ThreeThree-Dimensional Viewing
Chapter 7
Viewing Pipeline
How to define a window? How to project onto the window?
Rendering
"Create a picture (in a synthetic camera)"
n n
Specification of projection type Specification of viewing parameters
n
viewer's eye,
Curves and Surfaces
Chapter 8
Representation of Curves and Surfaces
n
Key words
n n n n n n
surface modeling parametric surface continuity, control points basis functions Bezier curve B-spline curve
Why we need surface models?
n
All shapes can be describe