8. Hierarchical Graphics, (Scene) Graphs
notes from Angel for UFL graphics
Example Hierarchy Robot:
R (base) T R (lower arm) T R (upper arm)
Jrg Peters
o
Cex/8arm.c
Torso
Mh
Mlua
Head
Left-upper
arm
Mrua
Right-upper
arm
Mlla
Left-lower
arm
Mlul
Left-upper
7. Discretization (Rendering to Grid)
notes for UF computer graphics
Jrg Peters
o
Hidden-surface removal z-buer
z-buer contains closest object so far:
If z-buer value is less than new vertex z-value do not render new
z1
z2
COP
Hidden-surface removal depth
6. Illumination, Lighting, Vertex Shading
notes for UFL graphics
Jrg Peters
o
No ray tracing in OpenGL!
ray tracing: direct paths
interreection: soft shadows, color bleeding.
COP
umbra, penumbra, shadows: Cex/cubes.c
Illumination
Global lighting model = e
5. Viewing
notes for UFL computer graphics
Jrg Peters
o
Projections Perspective
glPerspective (fovy,aspect,near,far)
Modelview Projection perspective division.
w
y
h
View volume
fov
x
View
plane
z
Nonuniform shortening: yp
the z axis.
1
0
Pz :=
0
0
Front
4. Geometric Objects and Transformations
notes for UF computer graphics
Jrg Peters
o
Choosing the right Coordinate Space
Computer Graphics: Render objects in the Euclidean Plane.
However, the computational space is better viewed as one of
Ane Space
Proj
3. Input and Interaction
notes for UFL graphics
Jrg Peters
o
Example interfaces:
Sketchpad Sutherland
Sketch Brown University, J. Hughes
Teddy Siggraph 99
Note: interaction is system dependent, hence in GLUT.
physical devices: mouse, trackball, keyboar
2. Basic openGL Programming (notes for
UF graphics, Jrg Peters)
o
Global state
OpenGL is not object oriented!
It has a global state organized as a tree-like stack via push and pop separators.
image = GS(attributes; objects)
Primitives : (what, shape node
yH y` u V e i u y HSS v cS t` u e H S H e cS i Pt H P
jSGqtTRPjqtQSugGbSTc RPgIsSQqHUbdTp3EpQxu p UspuGrRgU
` yH y` u H ` P u S y HSS v cS t` u e H S H e cS i Pt H P ` e
GepejSGqtTPqtTbSBfcQg iRgIbQHqUCUsGQpw3pQu ( bguGjRgUdp
d b3
f
cH V y S e cP S
G
PI tg PI I q A
G
G
iT3icbRoT1Y`!5X d PI PISt3hthY)1YXacgb`UTYR$3il3
Rx r` G
G ` V V T` R
bPP9A 3!P9WP m
0 8 8 2D& 2 8 B ( ( BD&8
)D 52 5 90 D 3E 9h8 mD 955
`
&50 `35yPx8r( 8 1 Y`P& W1y1AX(` 0 ( D 12 3 5 D5 E CD D m0 39 rtm9P2
&T V
50 hc & x D h 8
J Peters lecture notes
II The univariate Bernstein-B zier form of a polye
nomial on the interval
are
@
A
4
7!
86531)' &
4 20 (
#%
$"
!
When the degree is understood, we drop the subscript
degree in Bernstein (B zier) form has the representation
e
'
%&%0 &
P'3d8'%
0 | I %0 G 4 & % (G % I 0 (2 I 2 02 & & | z 7 & G7 GEE 207 G t s2 |E7G
h'd3PPPyP&x`)~G'wh30'yxBx8'[email protected] )3HxPxy'%'qq)w
z 4& r %G 7 4 % ( &
`wxDP)mf86&8&1wt8
p d j d
GE (02 zgep X a X
0PH12hxP6&HHH5`H)' Pa
A 'DAD yW 80')~P
CC A C
10. Curved Geometry in 2 variables
glMap2
In two variables, a 4-sided polynomial piece (or patch )
p(u, v ) =
c(i, k )Bj,i (u)Bk,l (v )
i+j =d1 k+l=d2
glMap2* (target,u start, u end, ustride, uorder,
.
v start, v end, vstride, vorder, *points)
y
u=1
p(u,
2. Curved Geometry in 1 variable
notes for computer graphics
Jrg Peters
o
glMap, gluNurbsCurve, splines, subdivision
Domain, Range and Maps
f(u,v)
f(u)
x(u,v), y(u,v)
x(u),y(u)
x(u,v),y(u,v),z(u,v)
x(u),y(u),z(u)
Graph of a function, 1-Manifolds, 2-Manifo