Академический Документы
Профессиональный Документы
Культура Документы
2 GRAPHICS
AND MULTIMEDIA
THREE
DIMENSIONAL
CONCEPTS 2.3
As vertex values and other information are enteredinto the . Another similar function in the quadrilateral mesh,which
polygondatastnrcture,valuesforA, B, C andD arecomputed generates a meshof (n-l) by (m-l) quadrilaterals,
giventhe
for eachpolygonandstoredwith the otherpolygondata. coordinatesfor an n by m arrayof vertices.Figure2.5 shows
Planeequationsareusedalsoto identifuthepositionof spatial 20 verticesforminga meshof l2 quadrilaterals..
pointsrelativeto the planesurfacesofan object. For anypoint 2.2.2 Curued Lines and Surfaces
(x,y,z) hot on aplanewith parametersA,B, C, D, wehave . Displaysofthree dimensionalcurvedlinesandsurfacecanbe
Ax+By*Cz+D+0 generatedfrom an input setofmathematicalfunctionsdefining
Wecan identiff the point aseitherinsideor outsidethe plane the objectsor from a setofuser speiified datapointS.
surfaceaccordingto thesign(negativeor positive)ofAx + By + . Whenfunctionsarespecified,apackagecanprojectthedefining
Cz+D:
equations
for a curveto thedisplayplaneandplotpixelpositions
ifA* + B, * C" + D < 0, the point (x, y, z) is insidethe surface alongthepathofthe projectedfunction
ifA + B, * i, + D > 0, thepoint (x,y,z) is outsidethe surface. . Forsurhces,a functionaldescriptionin decorated
to producea
Theseinequalitytestsarevalidinarighthandedcartesian
system, polygon-meshapproxiationto the surfacs.
providedtheplaneparametersA,B, C andD werecalculated
2.2.3 Quadric Surfaces
usingverticesselected
in a counterclockwiseorderwhenviewing
thesurfacein anoutside-to-insidedirection. . Thequadricsurfacesaredescribedwithseconddegreeequations
Polygon Meshes (quadratics).
. A singleplanesurfacecanbe specifiedwith a functionsuchas . They include spheres,ellipsoids,tori, paraboloids,and
fillArea. But when objectsurfacesareto be tiled, it is more hyperboloids.
convenientto specifythe surfacefacetswith a meshfunction Sphere
. Onetypeofpolygon meshis thetriangle strip.
. In carteriancoordinates,
a sphericalsurfacewith radiusr centered
. This functionproducesn-2 connectedtriangles(figure2.4),given
on the coordinatesorigin is definedasthe setofpoints (x, y, z)
the coordinatosfor n vertices. thatsatisfytheequation. '.;
x'ry'+* = f
. The sphericalsurfacecanberepresented in parametricform by
usinglatitudeandlongtitudeangles(figure2.6).
Figure2.4 Figure2.5
2.12 AND MULTIMEDIA
GRAPHICS THREE
DIMENSIONAL
CONCEPTS 2.13
r ' r 2 / \ 2 r ' r 2
l r l * l r l .( .[, /1 -] r
,\r./
[rrl
x = rcoso
cosl,
Figure2.6'
-/,
, ,.l
< + < y"l
X = r * c o s g c -o%
s o= ,O s % 1\
- - t I y = r y c o s $ s i n Q ,- n 1 Q < n
- t
I:_l:asij!q0,
.- r
-n 1 d 3 n | |\
(a) z = r,sinO
-.To l) Torus
. The parameterrepresentationin equation (a) provides a . Torusis a doughnutshapedobject(figure2.8).
symmetricrangefor the angularparameter0 and$. . It can be generatedby rotatinga circle or other conic abouta
Ellipsoid specifiedaxis.
. Ellipsoid surfaceis anextensionofa sphericalsurfacewherethe
radiusin threemutuallyperpendiculardirectionscanhavedifferent
values(figure2.7).
riitJ itri l
Figure2.7
2.14 THREE
DIMENSIONAL
CONCEPTS 2.1s
GMPHICSAND MULTIMEDIA
t
L'- ;till' .[;)' ='
calledcontrol points which indicatesthegeneralshapeofthe
2. Wecanstatethematrixthatcharacterizes
thespline;(or)14gJ4il
3. we canstatethe setof blendingfunctions thatdeterminehow
Figure2.11
specifiedgeometrjcconstraintson the curvearecombinedto
Parametric Continuity Conditions
calculatepositionsalongthecurvepath
Fora smoothhansitionfrom onesectionofa piecewise ' To illustratethesethreeequivalent
parametric specifications,supposewe
curveto thenext,variouscgtlnuj&ongllions
arsneededal havethefol lowingparametriccubicpolynomialrepresentation
theconnectionpoints.
for thex coordinatealongthepathof a splinesection.
Ifeach sectionof a splinein de"icribedwith a set : a-ut-[. u-Fc, u+d*, 0< u <l
ofparametric $EI ...(c)
coordinatefunctionsofthe form
Boundaryconditionsof this curve is set on th" end point
x : x(u),y : y(u),z = z(u),u, SuSu, ...(b) coordinatex (0) andx ( I ) andtheparametrii first derivativesat
?(d^ theendpointsxr (0) andxt (r).
We set naramefric continuity by matching :rDt Thesefour boundaryconditions
the parametric
derivativesofadjoiningcurvesectionsattheircommon .'\td) are suffrcienttodeterminethevaluesofthe fourcoefficientsa .
boundarv. ar..a'
'tuSq.s't.andd"
L ^ ^--rr
ndd.
={
b>
.,
,
I
t
2.18 GRAPHICS
AND MUTTIMEDIA hnrr onnrNsroNALcoNcEPTs 2:9
( !
1
f, Wtreregkarethe constraintparameters,suchascontrol point
coordinateandslopeofthe curveatthecontrolpointsandBFu(u)
arethepolynomialblendingfunctions.
L;:J
I
...(d)
).2.5 BezierCurvesand Surfaces
= U.C
BezierCurves Igtl" \
| . A Beziercurvecanbefitted to anynumberofcontrol points.
WherqU is therow matrixofpowerofparameterU andC is the I
j
THREEDIMENSIONALCONCEI.'iS 2.21
2.20 GMPHICSAND MULTIMEDIA
Figure2.12demonstratesthe appearance of someBeziercurves
BEZk,^(u)= (t-u)nEZu,"_,
(u)*uBEZu_,,"_,
(u), for variousselectionof controlpointsin thex y plane(z : 0).
n>k>1 ...(4) . Beziercurvesareusedin paintinganddrawingpackages
aswell
:
With BEZhu u*,and BEZo,u 11 u)k : - asCAD systems,sincetheyareeasytoimplementandtheyare
. Vectorequation( I ) represents
a setofthreeparametricequations powerfulin curvedesign.
for the individualcurvecoordinates: Properties of Bezier Curves
. A very usefulpropertyofa Beziercurveis that it alwayspasses
x (u) = i xuBEZu,,
(u) throughthe first and last control points. i.e., the boundiry
k=0 conditionsatthetwo endsofthe curveare
+. P(0) : Po
y(u) = )vuBEZu,(u)
k=0
"-.(s) P(1) : P.
..3.
z(u) = )zuBEZn,.(u) Valuesofthe parametricfirst derivativesof a Beziercurveatthe
k=0
endpointscanbecalculitedfrom controlpoint coordinates as
Figure2.12
2.22
GRAPHICS
AND MULTIMEDIA
THREEDIMENSIOI.IAT
CONCEPTS 2.23
. n
lvnzu.,(u)= r
k=0
(or)
[][;til|'
P' = T.p
...(
r)
' To generatea rotationtransformationfor
'
an obiectanaxis of
rotationmustbedesignedto rotatetheobject*itn. a-o*iof
angularrotationis alsobe specified.
Positiverotationanglesproducecounterclockwiserotations
Parameterst abouta coordinateaxis.
,h."";;;;;;;";;#,1#li,';'*':uj:-":f;:'::TJ::ffi
l: Co-ordinate Axes Rotatlons
(Figrire2.t5).
The 2D z axisrotationequationsareeasilyer<tended
to 3D.
. The matrix reDresenfrfinn
presentationin
i- o^,,*
equation (l) in equivalentto the xt x cos0- y sin0,
threeequations.
v' xsin0+ycos0 ...(2)
1'_ X*t^,
z' z
Y'= y*tr,
Parameters 0 specifiesthe rotationangle. In homogeneous
7t _ z*trt
coordinateform, the3D z axisrotationequationsareexpressed
as
y axts
-sin0 0 0l
[*'l fcos0 lxl
lv'l J s i n Oc o s 00 o l l u l
l ' ' l =ol o r ' l l ; l
L'] [o o or]LrJ
Whichwe canwrite morecompactlyas
p'= Rr(O).p
...(4)
Figure2.l5
2.28
GRAPHICS
AND MULTIMEDIA
Figure2.15 illustratesrotation THREE
DIMENSIONAL
CONCEPTS 2.29
ofan objectaboutthez axis.
Rotationofan objectaroundthex-axisis demonstrated
in fizure2.17.
Figure2.l6
Figure2.17
Transformationequations
for rotation about the other Cyclicallypermutingcoordinates in equation(6) givethe
coordinateaxescan be obtained two
with a cycricpermutation transformation
equation
foray axisrotation.
coordinateparameters of the
x, y and, in "quutio;A)
replacements ;;:;"r. ,n, z'= zcosO-xsin0l
' x'= zsinO+xcos0f
x-+y*)z_+x
y,=y "'(e)
...(s) -J
Thematrii representation
for y-axisrotationis
:::Tl:T_-T::rmutations(5)inEquationlz;,wgettr,liluution,
foran x-axisrotation:
[r'l I cosO 0 sinO ol [*l
l ' ' l = [o 0r c oo s ool l' ll' lr l ...( 10)
Y , =ycos0-zsin0l
z ' = ysin0+r"ore
i ...(6) lr'l l-sine
x )
L'J I o
x t =
o o r.llr.l
Whichcanbbwrittenin the
homogeneous (or) P' = R, (0).P
coordinateform
An exampleofy axisrotationis shownin figure2.1g.
f*'l fr o 0 ol f.l
ly'l lo coso 0
-sin oll'l
l ' ' l = l or i n ecos0 oll.l ot
LrJ lo o 0 ' JL ' J
(or) P' = R.(o).p
...(8)
Figure2.l8
2.30 GRAPHICS
AND MULTIMEDIA 2.31
THREE CONCEPTS
DIMENSIONAL
' An inverserotationmatrix is formedby repracingthe rotation 3 . Translatethe objectsothat the rotationaxis is movedbackto its
angle0 by-€. originalposition.
' Negativevaluosfor rotationangresgeneraterotations
in a Whenanobiectis to berotatedaboutanaxisthatis notparallel
clockwisedirection,sotheidentitymatrixisproducedwhen t )rnenfthe cnordinate axes, we need fo perFnrm srime additio,nal
any
rotationmatrixis multipliedby its inverse. langfpnations.
' sinceonlythesinefunction
is affectedby thechangein signof In suchcase,we needrotationsto aligntheaxiswith a selected
- therotationangre,the
inversematrix canarsobe obtainedby coordinateaxis and to bring the axis back to its original
interchangingrowsand corumns.(i.e.)we cancarcurate orientation.
the
inverseof any rotationmatrix R by evaruatingits transpose
fortherotationaxisandtherotafionangle,
Giventhespecifications
(R'r : ftr;.
we canaccomplishtherequiredrotationin five steps:
gene.A fnreeOtme
l . ___ theobject
Translate
' A rotationmatrix for any
axis that doesnot concidewith a coordinateorigin.
coordinateaxis can be setup as a compositetransformation
involvingcombinations.of translationsandthecoordinate
axes
rotations.
a
5. Performthe specifiedrotationaboutthat coordinateaxis.
backtoitsoriginal
4 . Apply inverserotationsto bringtherotationa><is
-zr. Seftingupthetpnsformationsequence thatmovestheselected orientation.
rotationaxisontooneofthe eoordinate
axes.
5 . Apply theinversetranslationto bringtherotationaxisbackto is
4. Thensetuptherotationmatrixaboutthatcoordinateaxis
forthe originalposition.
ed rotation angle.
./lpecifi 2.3.3Scalin_e
'3. obtaining the inverse
transformationsequence that retumsthe . Themaftixexpression ofa position
forthescalingtansformation
rotationaxisto its originalposition.
=
P (x,y,z) relativeto thecoordinateorigincanbewrittenas
' In thespecialcasewhere -]
anobjectis to berotatedaboutanaxis
til
that is parallelto oneofthe coordinateaxes,we canattain
desiredrotationwith thefoilowingtransformation sequence :
the
[.'l li :,::l
l;:l=L:: ;"llf;l
\''j
I . Translatethe objectsothatthe rotationaxiscoincides
paralleI coordinateaxis.
with the
L'j L;j
...(11)
Ir
2. Performthe ipecifiedrotaticjnaboutthataxis.
2.32 GRAPHICS
AND MULTIMEDI, THREE CONCEPTS
DIMENSIONAL 2.33
4*,
Explicit expressionsfor thecoordinatetransformations
for scaling (xr,yr,zr)
relativeto theorigin are 'a-a
X
xt *'r.l (a) (b)
y' v . sl , . . .l(3 )
z' x'srJ
tL s x 0 0 (t-s*)xrl
h^^'Plv
- Q
.' 0^-i
ls o t r o (r-.,)v,I
Figure2.lg
0 0 s z (t-1.),,1 ...(14)
0 0 0
Scalingwith respectto a selectedfixedposition (xnynz)can be
represented Inversescalingmatrix m formed by replacingthe scaling
with thefollowingtransformation r"qu.n.",
parameters
s*,s, ands"with theirreciprocals.
l . Translatethe fixed point to the origin.
, - t
ftn,
Theinversematrixgeneratesanoppositescalingtransfo
r
2 . Scaletheobjectrelativeto thecoordinateorigin usingequation ,
eproduces
(ll). the identitv matrix.
2.34
GRAPHICS
AND MUTTIMEDTA THREE
DIMENSIONAL
CONCEPTS 2.35
2.3.4 Other Transformations
Reflections
'-F---.GqraF
a
@
qrtserwithrespect
tbu r",".,"#on
- - . - . x -
o Shearingtransfori'natibnsare
' usedto modify object shapes.'
Reflectionrerativeto a given
axisareequivarent
to r g00rotations ' They arealsousedin three
abouttheaxis. dimensionarviewing for obtaining
generalprojectionstransformations.
. Whenthe
reflectionplanein a coordi Thefollowingtransformation
producesa z-axisshear.
v,)thenthetransrormation
canr; ; ff:HfJ;ff:};
handed
andrighrhandedsystems. H:
. An example ir 0a ol
ofa reflectionthatconverts
coordinatespecifications SH, = lo
lb ol
handed'v't"t
tourrt-r,-dedsvstem ol
ffn::Ht rrrr,o*nin l0 l0
' Thistransformation
Lo 0 0 rl
changesthesignofz coordinates,
. x andyboordinatevalues,u""n*j"0. reaves
the . Parameters
a andb canbe assignedanyreal values.
' Thematrixrepresentation 'Qhis transformationmatrix
for thisreflectionofpoints is usedto arterx andy coordinate
thexyplaneis rerativeto valuesby an amountthatis proportionalto the z value,and
thez
coordinatewill bechanged _
f r o o ol
* = ;l ;. "
7
' Boundariesofplanesthat
areperpendicularto the z axisare
0l shifted by an amountproportionalto z figure 2.22 shows
0l effectof shearing
the
matrixon a unitcubefor thevaruesa = b - r.
1 0 0 0 IJ
Reflection
relative{o the
XY plane
X:>
(a)
Figure2.2l
Figure2.22
2.36
GRAPHICS
AND MULTIMEDIA THREE
DIMENSIONAL
CONCEPTS 2.37
2.3.5 CompositeTransformations
. Compositetransformationcanbeconsftuctedwith thefollowing
functions:
composeMatrix3 \/
ilr thetransformation
sequence.
buildTransformationManix3/ /
This concatenationis carriedout from right
to left, wherethe composeTransformationMuur*d
right mostmatrix is the first transformation
to be appriedto an . The order of the transformation sequence
objectandtheleft mostmatrix is thelasttransformation. for the
buildrnansformationMatrD<3 & composeTransformation Matrix3
$sequenceofbasig, ratien, functions,is thesameasin 2 dimensions:
{
l) scale. 2) roete and 3) tqpslate
. OnceJt.unrfor-ation matrix is specified,the matrix
canbe
2.3.6 Three DimensionalTransformation
Functions appliedto specifiedirointswith
Someofthe basic3D transformationfunctionsare: transformPoint3(inPoint,matrix,outpoint)
translate(translateVector,
matrixTranslate) ' Thefiansformations for hierarchicalconsftuctions
canbesetusing
rotateX(thetaX,xMatrixRotate) structureswith thefunction
sefl.ocalTransformation
3 (matrix,type)
rotateY(thetal yMatrixRoA!e),
whereparametermatrix specifiesthe elementsof a 4 by 4
rotateZ(thetaZ,zMatrixRotate).
transformationmatrix,andparametertype canbeassignedone
scale3(scaleVector,
matrixScale), ofthe valuesof: preconcatenate,
postconcatenate,
or replace..
' Eachofthesefunctionsproducesa4by 4transformation 2.3.7 Modeling and CoordinateTransformations
matrix
thatcanbe usedto transformcoordinatepositions .
expressed
as Jn mo.deling,o!&gll4ry_dgpqbed in a local (modeline)
homogeneous columnvectors. coordinatereferenceframe,ttrentheobiectsar ed
' Parametertransratevecior is a pointerio the rist i@
oftransration
distancestn,t, andt.. . Forinstance,
lables,chairsandgtherfumiture,eachdefinedin a
Parameterscalevectorspecifiesthethreescalingparameters R into the descriptionofa
s*o t
s, and s".
@m coordinates.
Thentheroommight
Rotateandscalematricestransformobjectswith respect be transfor*.d lntoffii"onstructed
to the in world
coordinateorigin. coordinate.
2,38 GRAPHICS
AND MULTIMEDIA / THREE
DIMENSIONAL
CCJNCEPTS 2.39
Threedimensionalobjectsand scenesareconstructedusing
structureoperations. Whichtranformsunit vectorsu* , uy and u, ontothex, y and
;
l
z:rxesrespeciively.
object descriptionis transformedfrom moderingcoordinateto I
world coordinateorto anothersystemin thehierarchy. ) ' The completecoordinate-transformation
sequence
is given by
)
the compositematrix R.T.
)f
I This matrix conectly transformscoordinatedescriptionsfrom
j
I
I onecartesiansystemto anotherevenifone systemis left-handed
' I andtheotheris right handed.
Transformationmatix hasto besetupto bringthetwo coordinate i
systemsintoalignmenf )
- First'aJranslationis setup to )
bring thenew coordinateorigin I
I
to thepositionofthe othercoordinateorigin. {I
I
- Thena sequenceotatartiansare I
madeto thecorresponding
coordinateaxes. \
(i.e.)pointingthecameraand
rotatingit aroundthe line of right to setup the directionfor the Specifiyingtheview plane
ryfire.
y'wn." .""n tlr" .l.,,'tq the sceneis croppedto the sizeofthe
'window'
ofthe camera,and light from thevisiblesurfacesis
I"
projectedinto the camerafi lm.
In such a way figure 2.24 showsthe three dimensional
IL,,
Po=(xo,yo,zo)
transformationpipeline,from modelingcoordinatesto final device
coordinate.
Figure2.25
The view for a sceneis chosenby establishingthe viewing
coordinatesystem,alsocalledtheview reference coordinate
system(figure2.25).
Projection Workstation
transformation transformation A gggp* or projectionplaneis set-upperpendicularto the
viewineZ
- c = axis.
ProcessingSteps Worldcoordinate
positionsin thescenearetansformedto viewing
- coordinates,
thenvjgwins coordinatesaren1g_iglteclrto
theview
l. Oncet\e scenehasbeenmodeled,world coordinatepositions
plane.
areconvertedto viewing coordinates.
Th. ylewrefeIgllcelqillljs a world coordinateposition,which
2. The{ip:ryingcoordinare
systemisusedin graphicspackages
asa
is the originofthe viewingcoordinatesystem.It is chosento be
ref,erence
for speciSingthe observerviewing positionandthe
closeto or on thesurfaceof someobjectin a scene.
positionofthe projectionplane.
J. Projectionoperationsare performedto convertthe viewing Thenwe selectthepositivedirectionfor theviewingZ axis,and
c-oodinde Oescript the orientationofthe view planeby specifyingtheview plane
n
the proiection normal vector, N. Here the world coordinateposition
f,lane,which will thenbe mappedto theoutput
device. establishesthedirectionforN relativeeithertotheworld origin
or to theviewingcoordinateorigin.
4. Objectsoutsidethe viewing limits are clippedfrom further
consideration, andtheremainingobjectsareprocessed Thenwe selecttheup directionfor theview by speci$inga vector
thrbugh
visible surfaceidentificationandsurfacerenderingprocedures V calledtheview-upvector. Thisvectoris usedto establishthe
to
producethe displaywithin the deviceviewport, positivedirectionforthe y.,axis.
2.42 GRAPHICS THREE
DIMENSIONAL
CONCEPTS
AND MULTIMEDIA 2.43
Theorthographicprojectionthatdisplaysmorethanonefaceof
@. Parallelprojectionsis specifiedwith a projecti6n vectorthat
anobject is calledgronomelri$ orthograph
ic projections.
Themostcommonlyusedaxonometricprojectionisj!$omesrc
definesthedirectionfor theprojectionlines.
projection.
lt canbe generatedby aligningtheprojectionplanesothat it
intersectseachcoordinateaxi3in wli'ichtheobjectis definedas
the samedistancefrom the origin. (Figure2.28). '
(x,y,z)
a
jection
Figure2.26
Orthographic projection
iectionsare usedto producethe front, side
andtop viewsofan object. (figwe2,27)
. Front,sideandrearorthogfaphicprojectionsofan objectare Figure2.28
calledelevations: Transformation parallelprojection
equationsfor anorthographic
a Atop orthographic
projectioniscalleda planview. arestraightforward. . t
a Thisprojectiongivesthemeasurementillenffi andangles lf the viewplaneis placedat positionz* alongthez, axisthen
accuratelv. any point (x, y, z) in viewing coordrftes is transfbrmedto
2.46
GRAPHICS
AND MUTTIMEDIA THREE
DIMENSIONAL
CONCEPTS 2.47
a
In figure2.29, uand are
$ two angles. WhereL, is the inverseoftan o, which is alsothe valueof L
a
Point (x, y, z) is projectedto whenZ: l.
position(xr, y/ on the view
plane.
. The obliqueprojectionequation(l) canbewrittenas
,',*?.-_-_-_
--n
9.
Thetransformationmatrix for producinganyparallelprojection
ontothex"y"planeis
Ir 0I L,cos$ ol
:l
Figure2.29
L, sin$
.
Theobliqueprojectionline from (x,y,z)to
(xo,y/ makesan
Mp.rll"l = lo 0 l
*nn thelineon theprojection
planethatjoins(xo,y/ and
l0 0 0 1J
il*;" L0
' line oflengthL in at anangle An othographicprojectionis obtainedwhenL, :0 (whichoccurs
Ihlt Qwith thehorizontaldirection {' -
in theprojectionplane. ataprojectionangleoofgOo)
. . Obliqueprojetionsaregenerated
with nonzerovaluesfor L,.
coordinatesareexpressed
in termsofx, y, L and
;::Otection
PerspectiveProj gfions
-
X o: X *Lcos . To obtainperspectiveprojectionofa 3D object,we transform
. . .( l )
Yo=Y+Lsin0 pointsalongprojection
linesthatmeetattheprojectionreference
LengthL dependson the point.
anglecrandthe z coordinate
pointto beprojected: of the . Ifthe projectionreferencepoint is setat positionz*alongthe z,
axisandtheview planeis placedatz. asin fi gure2.39,we can
tana=Z write equationsdescribingcoordinatepositionsalong this
L prerspectif.projectioulinein parametricform as
Thus €
-/'
x' = X-Xu
, = - = ZZ L ,
L d=
J
r-u
J JU
-/
tan c, I
//
,1 ..'
2.48 GRAPHICS (04/'
AND MULTIMEbh
THREE
DIMENSIONAL
CONCEPTS --Z--.'-' 2.49
Parameteru takesvaluesfrom 0 to l, andcoordinate
position
( X' , Y', z') represents
anypointalongtheprojectionline.
l 0 0 0
Whenu : 0, thepoint is at p: (x, y, z).
i;:l0 0 = % ,'-('%,)
a
0 l
a
At the otherendofthe line, u: I andtheprojection
f,.l
0 0
reference lvl
point coordinates(0, 0,
7 ).
Onthevieuplanez' - .. andz,can besolved
u at this positionalongtheprojectionline:
forparameter Lrl0 0 -%, '%,l ' l LIJ
P=(x,y,z) ln thisrepresentation,
thehomogeneous
factoris d
o- -ozwol&
--L*7
7 - - 7 / Y
h=-PrP ewtlX
de -I
tI
andtheprojectioncoordinateson theview pranearecalcurated
View plane from thehomogeneous coordinatesas
xp:Vh
Figure2.30
Yo: Yft
Substitutingthis
valueofu intotheequations
for x, and y,, we wherethe originarz coordinatevarueretainsin projection
obtaintheperspective
transformation
equations. coordinatesfor depthprocessing.
r zr"o-2,
- \ / or
, \
*o = *l 2.4,4 Three DimensionalViewing Functions
=
I *[ I
\zr*-z
) \.r*-. ) l. with parameters specifiedin worrdcoordinates,
erementsofthe
=r[#)
,,=,(ffiJ ...(2)
matrix for transformingworrd coordinatedescriptionsto the
viewingreferenceframearecalculatedusingthefunction.
evaluateMewOrientationMatrix3
(xo,yo,zo,xN, yN, zN, xy yV
where z.nis the distanceof the viewplanefrom '
!o:.n- the zV,enor,viewMatrix)
proJectlonrefbrencepoint.
- This fi.rnctioncreatestheviewMatrix
from inputcoordinates
Usinga 3D homogeneous coordinaterepresentationwe canwrite definingtheviewingsyskm.
theperspective-projection
transformation(2) in matrix form as - Parameters
Xo,yo,
zospecifythesignofthe viewingsystem.
2.50
GRAPHICS
AND MULTIMEDIA THREE
DIMENSIONAL
CONCEFTS 2.51
.= Worldcoordinate
vector(xN, yN, zN) definesthenormal - posibnsabng ihevbo lngz,axis
to for&refrontandbackplanes
theviewplaneandthe directionofthe
positivez..viewine ofthe view volumearegivenwith parametersz front andz
axis.
back.
- Theworldcoordinate
(xV,yy,zy)gives theelements - The errorparameterrefurnsan
ofthe integererror codeindicatine
viewupvector.
erroneousinputdata.
- An integererror
codeis generatedin parametererror 2.5 Color Models
if input
valuesarenot specifiedcorrectly.
color Model is a methodfor explainingthepropertiesor behavior
2' Themllrix nroj matrix for transforming
viewingcoordinates to ofcolor within someparticularcontext.
normarizedprojectioncoordinatesis
createdwith thefunction,
2.5.1 Propertiesof Light
evaluateVewMappingMatrix3
Qcwmin,xwmax,ywmin,lAtranax, ' - Lrght ls a narrowfrequency
xvmax, yvmin, yvmax, nmin,^rnu*, p.o;Typ", bandwithin the electromagnetic
5vmin,
xprojRef yprojRee zprojRef zview, system.
zback,rrrlnt, "oor,
projMatrix) ' other frequencybandswithin this spectrumare calledradio
- Window limits waves,micro waves,infraredwavesandx_rays.Figure2.31
on the view plane are given in viewing
coordinateswith parametersxwmin, showsthe frequencyrangesfor someof the electromagnetic
xwmax,ywmin and
ywma)( bands.
- Lirnits ofthe 3D
viewportwithin theunit cubeare
setwith t-
normalizedcoordinatesnrmin, xvmax,yvmin,yvmax,zvmin e E g b
andzvmax. E EZ Sl s ^ E
. E t . t o ' ; g
- ParameterprojType
is usedto choosethe projection
type |t
= F c € E sf
<-,->?9._r
eitherparallelor perspective. t ,t r l l l l l l F|<H<---}
r e q u e n c y
- Coordinateposition tH-"rti'
(xprojRefiyprojReezprojReD
setsthe
projectionreferencepoint. Thispoint Figure2.3l
is usedasthecenterof
projectionifprojType is setto perspective,
otherwise,this Eachfrequencyvaluewithin thevisible bandcorresponds
to a
pointandthecenterofthe vieuplane
windowdefinetheparallel distinctcolor.
projection vector.
At the fow frequencyend is a red color (4.3 x lOaHz) andthe
- Thepositionofthe
viewpranearongtheviewingz, axis highestfrequencyis a violet color (7.5 x I 0r4tIz).
is set
with parameterzview.
z- g*:vd+o;'J'fry
C,hvena6*
X:IY z = zy
v ' v
wherez:l_x_y
2.5.3 Intuitive Color Concepts
Colorpaintingscanbecreated
bymixing colorpigmentswith
white andblackpigmentsto form
thevariousshades,tints and
tones.
startingwith thepigmentfor a 'pure Figure2.32
coror',thecoloris addedto
\il,,,
Tonesofthe colorareproduced ofthe primarycolors.
by addingbothblacka"O*ii,"
pigments.
TheRGB colorschemeis anadditfuemoder.(i.e.)
Intensitiesof
RGB Color Model theprimarycolorsareaddedto produceother
colors.
Basedon the tristimulus theory Eachcolorpointwithin ttreboundsofthe cube
ofvision, our eyesperceive canberepresented
colorthroughtlrestimurationofthree asthetriple (R, q B) wherevaluesfor R, G and
visu,ar
pigmentsin thecones B areassigned
ofthe retina in the rangefrom 0 to l.
GRAPHICS
AND MUTTIMEDIA THREE
DIMENSIONAL
CONCEPTS 2.57
. The color Cl,
is expressedin RGB componentas . An NTSC Mdeo Signalcanbeconverted
to anRGB signalusing
CI" =.RR+GG+BB an NTSC decoder,which seperates
the video signalinto yle
' '
Themagentavertexis obtained components,
thenconvertstoRGB values,asfollows:
by addingredandbrueto produce
thetriple.( l, 0, I ), andwhite
at (1, l, l) in the sumofthe red,
yl
greenandbluevertices.
, [*l = fr ooo-0.272
0.e56o 620
l f
-0.647 t
' shadesofgray o r.oo0
arerepresentedalongthe main I | | |l I
cubefrom the origin (black) to
the white vertex.
diagonarofthe
LB.j Ll.ooo_l.lo8 t.705
J Lal
2.5.5 yleColorModel 2.5.6CMY Color Model \J\!1f49,
' TheNationarTerevisionSystem
committee(t{rSC) corormodel
a
A color modeldefinedwith theprimarycolorscyan,magenta,
for formingthecompositevideo andyellow (CMY) in usefulfor describingcolor outputto hard
signalin theyle model.
^ UV copydevices.
Y4 t tfr. oR corormoder,ruminance
,.r (brightness)informationin
n(hueand It it "
@i.e) cyancanbeformedby adding
VrZi:ffi;iiJ
v ' A combination
greenandblue light. Whenwhite light is reflectedfrom cyan_
coloredink, thereflectedlightmusthaveno redcomponenti.e.,
ofred, greenandbrueintensities
arechosenfor red light is absorbedor substracted
theyparameterto yield the standard.luminosity by the ink.
culve.
' since ypontains Magentaink subtactsthe greencomponentfromincident light
theruminanceinformation,brack
andwhiteTV andyellow subtractsthe bluecomponent.It is representedin
monitorsuseonlytheysignal.
w
0,J6
ParameterI containsorange_cyan
hue informationthatprovides
theflash-toneshadingandoccupies
a bandwidthof 1.5Mr{,.
Parametere carries green-magenta
hue information in a
figure2.33.
M
V bandwidthofabout 0.6L/frIt.
An RGB signalcanbeconverted
to a TV signalusinganNTSC
Black
Gray
encoderwhich convertsRGB scale
valuesto yle values,asfollows.
frl
r = lo.zes
I I io.seo
0.587 o.t44l
4..27s -0.32t[Rl
I lo I
,#
Lai lo.zrz-0.528 o.3r
I J LBj Figure2.33
*f*ry
2.58
GRAPHICS
AND MULTIMEDTA THREE CONCEPTS
DIMENSIONAL 2.59
' In cMY moder,point (1, l, r) represents
brack,because
arl 2.5.7 HsvColorModel
componentsofthe incidentlight aresubtracted.
. TheHSV'modelusescolordescriptions
thathavea moreinteritive
. Theorigin represents
whitelight. appealto a user.'
. Equalamountsofeach
ofthe primarycolorsproducegraysalong . Colorparametersinthis modelarehue(H), saturation(S),and
themain diagonalofthe cube.
value(V).
. A combination
of cyanandmagentaink produces . The 3D representation
ofthe HSV modelis derivedftom the
blue light
becausethe red andgreencomponents
ofthe incidentrightrre RGB cube.Theoutlineofthe cubehasthe hexagonshape.
absorbed.
. The boundaryof.flreheiagon representsthevarioushues,andit
' Theprintingprocessoften usedwiththecMymodel generates is usedasthetop of the HSV hexcone(figure 2.34).
a colorpoint with a collectionof4 ink
dots;onedot iJusedfor
eachofthe primarycolors(cyan,magenta
andyellow) andone
dot in black.
. The conversion
from an RGB representationto
a CMy
representation
is expressed
as
lfl||til
wherethe white is represented
columnvector.
in theRGB systemastheunit
I
ValueV variesfrom 0 at the apexto I at the top. a Magentais at 60",Red in at l2}",and cyanin at H = 1g0".
a
- The apexrepresentsblack.
# backgroundcolor.
The animationis accomplishedby changingthecorortable
vahfessothattheobjectis 'on' at successive
positionsalong
the animationpath as the precedingposition is setto the
..
parameterscontrol suchobjectcharacteristics
fgEds, motion
=-- limitations
2.66 GRAPHICS
AND MULTIMEDI THREE
DIMENSIONAL
CONCEPTS 2.67
N,='"[k) transformcoordinate
. Wecanapproximate
positions.
thepathofa bouncingball with a damped,
Thepreprocessing rectified,sinecurve(figure2.38).
is accomplished
by
y(x) : A/sin(or*+0")/e-t*
l. dividing\ edgesofkeyframer" into
\ * I sections. WhereA is the initial amplitude,ol is the angular@uency, 0ois
2. dividingtheremaininglipesofkeyframe* intoN" sections. thephaseangle,andk is thedampingconstant.
2.68 GMPHICSAND MULTIMEDIA
\ A
l r \
\ r l r . .
I , I /-"\
r J I r ' \
r t 1' , , f tI
-q.
t /
'll J \ z
\i ii \l t
l l i l l l 1l /^trr\ r".
Figure2.38
Goal Directed Systems
* ' we can specifythe motionsthat are to takeplacein generat
termsthat abstractlydescribethe actions.Thesesystemsare
calledgoal directed becausetheydeterminespecificmotion
parametersgiventhegoalsofthe animation.
Eg.Tospecilyanobjectto' walk' orto' run'to aparticulard
istance.
Kinematicsand Dynamics
' with a kinematicdescription,we specifytheanimationby motion
parameters (position,velocity,andacceleration)
withoutreference
to the forcesthat causethemotion.
Forconstantvelocity(zeroacceleration)we designate themotions
ofrigid bodiesin a sceneby givinganinitialpositionandvelociq,
vectorfor eachobject.
Wecanspecifoaccelerations (rateof changeof velocity),speed
up, slow downs,andcurvedmotionpaths.
An alternativeapproachis to useinversekinematics;where,
theinitialandfinalpositionsoftheobjectarespecifiedat specified
timesandthe motionparametersarecomputedby the system.