Upload
anonymous-2rwncqlrp
View
8
Download
0
Embed Size (px)
Citation preview
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 1/51
PE-3011 :CAD/FEA
Prof. CHARLTON S. INAODefence University College of Engineering
3D
Transformations
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 2/51
Instructional Objectives
At the end of the session, the
students should be able to
demonstrate knowledge and be able
to:• Discuss the 3D transformation
concepts
• Discuss the algorithms for removing
hidden line, shading and coloring
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 3/51
Background/Review
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 4/51
3D Transformations• 2D transor!ation can "e e#tended to 3D transor!ation
in 3D s$ace using %o!ogenous coordinate s&ste! wit'!atri# !et'od(
)# & *+ )#(' &(' *(' '+
• ,ransation:
• .caing:
,
1000
000
000
000
z
y
x
S
S
S
1
0100
0010
0001
z y x T T T
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 5/51
Reection!irroring:
−
−
=
−
−=
−
−=
−
−−=
−
=
−=
−=
1000
0100
0010
0001
1000
0100
00100001
1000
0100
00100001
1000
0100
00100001
:Re
1000
0100
0010
0001
1000
0100
0010
0001
1000
0100
0010
0001
:Re
z
x xOrigin
yz xz xy
T
T T T
axisanabout flection
T T T
planeaabout flection
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 6/51
• Rotation: n 3D we rotation is a"out an a#is nota"out a $oint ike in 2D and $ositive ange is taken to"e ccw rotation(
Rotation about Z-axis Rotation about X-axis
Rotation about Y-axis
−=
1000
0100
00
00
θ θ
θ θ
CosSin
SinCos
R Z
−=
1000
00
00
0001
β α
α α
CosSin
SinCos R
X
−
=
1000
00
0010
00
φ φ
φ φ
CosSin
SinCos
RY
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 7/51
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 8/51
• Example: Rotation o a $oint P# & * a"out an& ar"itrar& a#is$assing t'roug' P1d e and P2g ' i( ,'e direction or t'eunit a#is vector u is deter!ined "& t'e s$eci4ed rotationdirection :
),,(|21|
21 cba P P P P u =
−−=
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 9/51
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 10/51
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 11/51
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 12/51
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 13/51
−=
1000
0//0
0//0
0001
)(d cd b
d bd c R
X α
−=
1000
00
00
0001
β α
α α
CosSin
SinCos R
X
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 14/51
( )
−=
1000
00
0010
00
d a
ad
RY β
−
=
1000
00
0010
00
β β
β β
CosSin
SinCos
RY
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 15/51
.te$ 3: Peror! t'e re5uired transor!ation rotationa"out t'e *- a#is(
−
=
1000
0100
00
00
)(θ θ
θ θ
θ CosSin
SinCos
R Z
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 16/51
*Go away from the origin,
back to initial position
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 17/51
EMOVING HIDDEN LINES
AND
SURFACES ALGORITHMS
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 18/51
REMOVI! "IDDE #IE$ %D $&R'%(E$ %D%#O!RIT"M$
Edges and suraces o a given o"6ect !a&
"e 'idden or visi"e in a given i!agede$ending on t'e viewing Direction(
,'e deter!ination o 'idden edges and
suraces can "e considered as a visi"iit&$ro"e!(
,'e soution to t'e $ro"e! o re!oving
'idden edges and surace draws onvarious conce$ts ro! co!$uting !ain&sorting and geo!etric !odeing !ain&$ro6ection and intersection(
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 19/51
A wide variet& o 'idden ine and 'iddensurace re!oving agorit'! is ine#istencetoda&( ,'e t&$e o gra$'ics dis$a& devices t'e&
su$$ort and "& t'e t&$e o data structureor geo!etric !odeing t'e& o$erate on-
wire ra!e surace or soid !odeinginuence t'e deveo$!ent o t'eseagorit'!s(.o!e s&ste!s use $arae $rocessing and
so!e use seria $rocessing( ,'e avaia"e agorit'!s can "e cassi4ed
into 'idden ine 'idden surace and 'iddensoid re!ova agorit'!s(
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 20/51
%idden ine and 'idden surace agorit'!s'ave "een cassi4ed as:
)* Ob+et $pae meto.s
/* Ima0e $pae meto.s
3* "1bri. Meto.s 2i is aco!"ination o
"ot'(An o"6ect 7s$ace agorit'! utii*e t'e s$atia
and geo!etrica reations'i$s a!ong t'eo"6ect in t'e scene to deter!ine 'idden and
visi"e $art o t'ese o"6ects(An i!age agorit'! concentrates on t'e
4na i!age to deter!ine w'at is visi"ewit'in eac' raster $i#e in t'e case o raster
dis$a&s(
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 21/51
2(0 !age s$ace !et'ods can "e urt'ercassi4ed as
/) Raster %l0oritms: ,'e& use a $i#e!atri#
re$resentation o t'e i!age(// Vetor %l0oritms: ,'e& use end $oint
coordinates o t'e ineseg!ent orre$resenting t'e i!age(
9ost 'idden surace agorit'!s use rasteri!age s$ace !et'ods w'ie !ost 'idden ine
agorit'! use o"6ect-s$ace !et'ods( ,'e o"6ect s$ace agorit'! are !ore
accurate t'an i!age s$ace agorit'!(
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 22/51
Re4ie2 56a70roun.
• - .troke writing and
• - Raster .can
• $tro7e 2ritin05 line.ra2in05ran.om position: eectron"ea! is directed ro! one $oint tot'e ot'er ike a $enci to create a ineand an i!age is or!ed out o t'ese5uence o straig't ine seg!ents(
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 23/51
Vetor or $tro7e 2ritin0
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 24/51
Raster $an:
• ,'e viewing screen is divided into arge nu!"er odiscrete $'os$'or $icture ee!ents caed Pi#es(
• ,'e !atri# o $i#e constitutes t'e raster(eg(2;#2;102<#102<
• Eac' $i#e can "e !ade to gow wit' a di=erent"rig'tness and coors(• An eectron "ea! creates t'e i!age "& swee$ing
aong a 'ori*onta ine ro! et to rig't andenergi*ing t'e $i#es in t'at ine and !ove to t'ene#t ine "eow and $roceeds in a 4#ed $attern asin 4g(
• ,'e $rocess is re$eated at rate o 30-;0 entirescans $er second
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 25/51
Pi#e
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 26/51
%l0oritm
• For a given t'ree di!ensiona scene a given viewing $oint anda given direction ei!inate ro! an a$$ro$riate two-di!ensiona
$ro6ection o t'e scene a $arts o edges and aces w'ic' t'eo"server cannot see(
• For ort'ogra$'ic $ro6ection t'e ocation o t'e viewing $oint isnot needed( ,'e two di!ensiona $ro6ection is aso known as t'ei!age $icture s$ace(
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 27/51
• A soid !ode is an idea
re$resentation( ,'e root o t'e treere$resents t'e t'ree di!ensiona scenei(e( Data"ases o wire ra!es andsuraces $o&gons and t'e order ot'eir edges cockwise(
• ,'ese !odi4cations are t&$ica&ac'ieved in an interactive wa& "&
re5uesting t'e user to digiti*e t'eedges o eac' ace in a given order(
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 28/51
• ,'e second ste$ is to a$$& t'e
$ro$er geo!etric transor!ations"ased on t'e viewing direction to t'et'ree-di!ensiona scene data too"tain t'e two di!ensiona i!age
>raw? data(• ,'ese transor!ations are used to
$roduce t'e de$t' inor!ation w'ic'is stored in t'e i!age data"ase or
de$t' co!$arison $ur$ose(
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 29/51
• ,'e ne#t ste$ are sorting and a$$&ingvisi"iit& tec'ni5ues deat esew'ere(@it' t'e co!$etion o t'e sorting
according to t'e visi"iit& criteria set"& t'e visi"iit& tec'ni5ues t'e'idden edges are identi4ed and
re!oved ro! t'e i!age data( ,'east ste$ in t'e agorit'! is to dis$a&or $ot t'e 4na i!ages(
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 30/51
SHADING
AND
COLOURING
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 31/51
$"%DI! %D (O#O&RI!.'aded coor i!age conve& s'a$e
inor!ation t'at cannot "ere$resented in ine drawings(
.'aded i!ages can aso conve&
eatures ot'er t'an s'a$e suc' assurace 4nis' or !ateria t&$e$astic or !etaic ook s'aded
i!age rendering agorit'!s 4terinor!ation "& dis$a&ing on& t'evisi"e surace(
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 32/51
9an& s$atia reations'i$s t'at are unresoved insi!$e wire ra!e dis$a&s "eco!e cear wit'
s'aded dis$a&s(Critica s'ading scene a $in'oe ca!era !ode is
a!ost universa& used(Rendering "egins "& soving t'e 'idden surace
re!ova $ro"e! to deter!ine w'ic' o"6ects
and/or $ortions o o"6ects are visi"e in t'e scene(As t'e visi"e surace are ound t'e& !ust "e
"roken down into $i#es and s'aded correct&( ,'is $rocess !ust take into account t'e $osition
and coor o t'e ig't sources and t'e $ositionand coor o t'e ig't sources and t'e $ositionorientation and surace $ro$erties o t'e visi"eo"6ects(
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 33/51
• ,'e various s'ading agorit'!s areavaia"e( A!ong t'e!
1( constant s'ading
2( ourad or 4rst derivative s'ading and
3( P'ong or second derivative s'ading
agorit'!s are ver& $o$uar(
• Coors aciitate creating geo!etr& anddis$a& i!age( Coors can "e used in
geo!etric construction( n t'is casevarious wire ra!e surace or soidentities can "e assigned di=erent coors todistinguis' t'e!(
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 34/51
Coor is one o t'e two !ainingredients t'e second "eing te#tureo s'aded i!ages $roduced "&
s'ading agorit'!s in so!eengineering a$$ications suc' as4nite ee!ent ana&sis coors can "e
e=ective& to dis$a& contour i!agessuc' as stress or 'eat-u# contours(
Two Main Ingredients:
1) Color
2) Texture
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 35/51
9icro$rocessor %eat .ink
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 36/51
E#a!$e o stress and 'eat u#contour o $iston
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 37/51
.tructura Ana&sis o 9ug@'ee
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 38/51
,ransonic Fow Around a 2Dairoi
i d
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 39/51
,ransonic Fow Around a 2Dairoi
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 40/51
eiet .u$er 9ac' Ra*or
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 41/51
3D si!uation on a ,unne
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 42/51
Constant .'ading• .'ading /Constant .'ading is a $rocess used in
drawing or de$icting eves o darkness on $a$er"& a$$&ing !edia !ore dense& or wit' a darkers'ade or darker areas and ess dense& or wit' aig'ter s'ade or ig'ter areas( ,'ere are various
tec'ni5ues o s'ading incuding cross 'atc'ingw'ere $er$endicuar ines o var&ing cosenessare drawn in a grid $attern to s'ade an area( ,'ecoser t'e ines are toget'er t'e darker t'e areaa$$ears( ikewise t'e art'er a$art t'e ines aret'e ig'ter t'e area a$$ears(
• ig't $atterns suc' as o"6ects 'aving ig't ands'aded areas 'e$ w'en creating t'e iusion ode$t' on $a$er(
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 43/51
1)Rendered image of a box. This image has
no shading on its faes! but uses edge lines
to se"arate the faes.
2)This is the same image with the edge lines
remo#ed.
$)This is the same image rendered with
shading of the faes to alter the olors of the
$ faes based on their angle to the lightsoures
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 44/51
Constant .'ading
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 45/51
ourad .'ading!ourau. sa.in0 na!ed ater %enri
ouraud is an inter$oation !et'od usedin co!$uter gra$'ics to$roduce continuous s'ading o suracesre$resented "& $o&gon !es'es( n$ractice ouraud s'ading is !ost otenused to ac'ieve continuous ig'ting ontriange suraces "& co!$uting t'e ig'ting
at t'e corners o eac' triange and inear&inter$oating t'e resuting coours oreac' $i#e covered "& t'e triange(ouraud 4rst $u"is'ed t'e tec'ni5ue in
11(
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 46/51
• ouraud s'ading is considered su$eriorto at s'ading w'ic' re5uiressigni4cant& ess $rocessing t'an P'ongs'ading "ut usua& resuts in a acetedook(
• n co!$arison to P'ong s'ading ouraud
s'adings strengt' and weakness ies in itsinter$oation( a !es' covers !ore $i#esin screen s$ace t'an it 'as verticesinter$oating coour vaues ro! sa!$es
o e#$ensive ig'ting cacuations atvertices is ess $rocessor intensive t'an$eror!ing t'e ig'ting cacuation oreac' $i#e as in P'ong s'ading(
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 47/51
• %owever 'ig'& ocai*ed ig'ting e=ects suc'as s$ecuar 'ig'ig'ts e(g( t'e gint o reectedig't on t'e surace o an a$$e wi not "e
rendered correct& and i a 'ig'ig't ies in t'e!idde o a $o&gon "ut does not s$read to t'e$o&gons verte# it wi not "e a$$arent in aouraud rendering
• Converse& i a 'ig'ig't occurs at t'e verte# o a$o&gon it wi "e rendered correct& at t'is verte#as t'is is w'ere t'e ig'ting !ode is a$$ied "utwi "e s$read unnatura& across a neig'"oring$o&gons via t'e inter$oation !et'od(
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 48/51
ourad .'ading
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 49/51
P'ong• P'ong s'ading reers to an inter$oation
tec'ni5ue or surace s'ading in 3Dco!$uter gra$'ics( t is aso caedP'ong inter$oation)1+ or nor!a-vector
inter$oation s'ading()2+ .$eci4ca& itinter$oates surace nor!as acrossrasteri*ed $o&gons and co!$utes $i#ecoors "ased on t'e inter$oatednor!as and a reection !ode( P'ongs'ading !a& aso reer to t'e s$eci4cco!"ination o P'ong inter$oation and
t'e P'ong reection !ode(
P'
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 50/51
P'ong
7/21/2019 week10 3d transformations nov 29 final.ppt
http://slidepdf.com/reader/full/week10-3d-transformations-nov-29-finalppt 51/51