交互式计算机图形学17章课后题答案.docx

上传人:b****5 文档编号:3606793 上传时间:2022-11-24 格式:DOCX 页数:16 大小:89.13KB
下载 相关 举报
交互式计算机图形学17章课后题答案.docx_第1页
第1页 / 共16页
交互式计算机图形学17章课后题答案.docx_第2页
第2页 / 共16页
交互式计算机图形学17章课后题答案.docx_第3页
第3页 / 共16页
交互式计算机图形学17章课后题答案.docx_第4页
第4页 / 共16页
交互式计算机图形学17章课后题答案.docx_第5页
第5页 / 共16页
点击查看更多>>
下载资源
资源描述

交互式计算机图形学17章课后题答案.docx

《交互式计算机图形学17章课后题答案.docx》由会员分享,可在线阅读,更多相关《交互式计算机图形学17章课后题答案.docx(16页珍藏版)》请在冰豆网上搜索。

交互式计算机图形学17章课后题答案.docx

交互式计算机图形学17章课后题答案

 

交互式计算机图形学(第五版)1-7章课后题答案(总13页)

Angel:

InteractiveComputerGraphics,FifthEdition

Chapter1Solutions

Themainadvantageofthepipelineisthateachprimitivecanbe

processedindependently.Notonlydoesthisarchitectureleadtofast

performance,itreducesmemoryrequirementsbecauseweneednotkeepall

objectsavailable.Themaindisadvantageisthatwecannothandlemost

globaleffectssuchasshadows,reflections,andblendinginaphysically

correctmanner.

WederivethisalgorithmlaterinChapter6.First,wecanformthe

tetrahedronbyfindingfourequallyspacedpointsonaunitspherecentered

attheorigin.Oneapproachistostartwithonepointonthezaxis

(0,0,1).Wethencanplacetheotherthreepointsinaplaneofconstantz.

Oneofthesethreepointscanbeplacedontheyaxis.Tosatisfythe

requirementthatthepointsbeequidistant,thepointmustbeat

(0,2p2/3,−1/3).Theothertwocanbefoundbysymmetrytobeat

(−

p6/3,−

p2/3,−1/3)and(p6/3,−

p2/3,−1/3).

Wecansubdivideeachfaceofthetetrahedronintofourequilateral

trianglesbybisectingthesidesandconnectingthebisectors.However,the

bisectorsofthesidesarenotontheunitcirclesowemustpushthese

pointsouttotheunitcirclebyscalingthevalues.Wecancontinuethis

processrecursivelyoneachofthetrianglescreatedbythebisectionprocess.

InExercise,wesawthatwecouldintersectthelineofwhichthe

linesegmentispartindependentlyagainsteachofthesidesofthewindow.

Wecoulddothisprocessiteratively,eachtimeshorteningthelinesegment

ifitintersectsonesideofthewindow.

Inaone–pointperspective,twofacesofthecubeisparalleltothe

projectionplane,whileinatwo–pointperspectiveonlytheedgesofthe

cubeinonedirectionareparalleltotheprojection.Inthegeneralcaseofa

three–pointperspectivetherearethreevanishingpointsandnoneofthe

edgesofthecubeareparalleltotheprojectionplane.

Eachframefora480x640pixelvideodisplaycontainsonlyabout

300kpixelswhereasthe2000x3000pixelmovieframehas6Mpixels,or

about18timesasmanyasthevideodisplay.Thus,itcantake18timesas

muchtimetorendereachframeifthereisalotofpixel-levelcalculations.

TherearesinglebeamCRTs.Oneschemeistoarrangethephosphors

inverticalstripes(red,green,blue,red,green,....).Themajordifficultyis

thatthebeammustchangeveryrapidly,approximatelythreetimesasfast

aeachbeaminathreebeamsystem.Theelectronicsinsuchasystemthe

electroniccomponentsmustalsobemuchfaster(andmoreexpensive).

 

Chapter2Solutions

Wecansolvethisproblemseparatelyinthexandydirections.The

transformationislinear,thatisxs=ax+b,ys=cy+d.Wemust

maintainproportions,sothatxsinthesamerelativepositioninthe

viewportasxisinthewindow,hence

x−xmin

xmax−xmin

=

xs−u

w

xs=u+w

x−xmin

xmax−xmin

.

Likewise

ys=v+h

x−xmin

ymax−ymin

.

Mostpracticaltestsworkonalinebylinebasis.Usuallyweuse

scanlines,eachofwhichcorrespondstoarowofpixelsintheframebuffer.

Ifwecomputetheintersectionsoftheedgesofthepolygonwithaline

passingthroughit,theseintersectionscanbeordered.Thefirst

intersectionbeginsasetofpointsinsidethepolygon.Thesecond

intersectionleavesthepolygon,thethirdreentersandsoon.

Therearetwofundamentalapproaches:

vertexlistsandedgelists.

Withvertexlistswestorethevertexlocationsinanarray.Themeshis

representedasalistofinteriorpolygons(thosepolygonswithnoother

polygonsinsidethem).Eachinteriorpolygonisrepresentedasanarrayof

pointersintothevertexarray.Todrawthemesh,wetraversethelistof

interiorpolygons,drawingeachpolygon.

Onedisadvantageofthevertexlististhatifwewishtodrawtheedgesin

themesh,byrenderingeachpolygonsharededgesaredrawntwice.We

canavoidthisproblembyforminganedgelistoredgearray,eachelement

isapairofpointerstoverticesinthevertexarray.Thus,wecandraweach

edgeoncebysimplytraversingtheedgelist.However,thesimpleedgelist

hasnoinformationonpolygonsandthusifwewanttorenderthemeshin

someotherwaysuchasbyfillinginteriorpolygonswemustaddsomething

tothisdatastructurethatgivesinformationastowhichedgesformeach

polygon.

Aflexiblemeshrepresentationwouldconsistofanedgelist,avertexlist

andapolygonlistwithpointerssowecouldknowwhichedgesbelongto

whichpolygonsandwhichpolygonsshareagivenvertex.

TheMaxwelltrianglecorrespondstothetrianglethatconnectsthe

red,green,andblueverticesinthecolorcube.

Considerthelinesdefinedbythesidesofthepolygon.Wecanassign

adirectionforeachoftheselinesbytraversingtheverticesina

counter-clockwiseorder.Oneverysimpletestisobtainedbynotingthat

anypointinsidetheobjectisontheleftofeachoftheselines.Thus,ifwe

substitutethepointintotheequationforeachofthelines(ax+by+c),we

shouldalwaysgetthesamesign.

Thereareeightverticesandthus256=28possibleblack/white

colorings.Ifweremovesymmetries(black/whiteandrotational)thereare

14uniquecases.SeeAngel,InteractiveComputerGraphics(Third

Edition)orthepaperbyLorensenandKlineinthereferences.

 

Chapter3Solutions

Thegeneralproblemishowtodescribeasetofcharactersthatmight

havethickness,curvature,andholes(suchasinthelettersaandq).

Supposethatweconsiderasimpleexamplewhereeachcharactercanbe

approximatedbyasequenceoflinesegments.Onepossibilityistousea

move/linesystemwhere0isamoveand1aline.Thenacharactercanbe

describedbyasequenceoftheform(x0,y0,b0),(x1,y1,b1),(x2,y2,b2),.....

wherebiisa0or1.ThisapproachisusedintheexampleintheOpenGL

ProgrammingGuide.Amoreelaboratefontcanbedevelopedbyusing

polygonsinsteadoflinesegments.

Thereareacoupleofpotentialproblems.Oneisthattheapplication

programcanmapdifferentpointsinobjectcoordinatestothesamepoint

inscreencoordinates.Second,agivenpositiononthescreenwhen

transformedbackintoobjectcoordinatesmaylieoutsidetheuser’s

window.

Eachscanisallocated1/60second.Foragivenscanwehavetotake

10%ofthetimefortheverticalretracewhichmeansthatwestarttodraw

scanlinenat.9n/(60*1024)secondsfromthebeginningoftherefresh.

Butallocating10%ofthistimeforthehorizontalretraceweareatpixelm

onthislineattime.81nm/(60*1024).

Whenthedisplayischanging,primitivesthatmoveorareremoved

fromthedisplaywillleaveatraceormotionbluronthedisplayasthe

phosphorspersist.Longpersistencephosphorshavebeenusedintextonly

displayswheremotionblurislessofaproblemandthelongpersistence

givesaverystableflicker-freeimage.

 

Chapter4Solutions

Ifthescalingmatrixisuniformthen

RS=RS(α,α,α)=αR=SR

ConsiderRx(θ),ifwemultiplyandusethestandardtrigonometric

identitiesforthesineandcosineofthesumoftwoangles,wefind

Rx(θ)Rx(φ)=Rx(θ+φ)

Bysimplymultiplyingthematriceswefind

T(x1,y1,z1)T(x2,y2,z2)=T(x1+x2,y1+y2,z1+z2)

Thereare12degreesoffreedominthethree–dimensionalaffine

transformation.Considerapointp=[x,y,z,1]Tthatistransformedto

p_=[x_y_,z_,1]TbythematrixM.Hencewehavetherelationship

p_=MpwhereMhas12unknowncoefficientsbutpandp_areknown.

Thuswehave3equationsin12unknowns(thefourthequationissimply

theidentity1=1).Ifwehave4suchpairsofpointswewillhave12

equationsin12unknownswhichcouldbesolvedfortheelementsofM.

Thusifweknowhowaquadrilateralistransformedwecandeterminethe

affinetransformation.

Intwodimensions,thereare6degreesoffreedominMbutpandp_have

onlyxandycomponents.Henceifweknow3pointsbothbeforeandafter

transformation,wewillhave6equationsin6unknownsandthusintwo

dimensionsifweknowhowatriangleistransformedwecandeterminethe

affinetransformation.

Itiseasytoshowbysimplymultiplyingthematricesthatthe

concatenationoftworotationsyieldsarotationandthattheconcatenation

oftwotranslationsyieldsatranslation.Ifwelookattheproductofa

rotationandatranslation,wefindthattheleftthreecolumnsofRTare

theleftthreecolumnsofRandtherightcolumnofRTistheright

columnofthetranslationmatrix.IfwenowconsiderRTR_whereR_isa

rotationmatrix,theleftthreecolumnsareexactlythesameastheleft

threecolumnsofRR_andtheandrightcolumnstillhas1asitsbottom

element.Thus,theformisthesameasRTwithanalteredrotation(which

istheconcatenationofthetworotations)andanalteredtranslation.

Inductively,wecanseethatanyfurtherconcatenationswithrotationsand

translationsdonotalterthisform.

Ifwedoatranslationby-hweconverttheproblemtoreflectionabout

alinepassingthroughtheorigin.Frommwecanfindananglebywhich

wecanrotatesothelineisalignedwitheitherthexoryaxis.Nowreflect

aboutthexoryaxis.Finallyweundotherotationandtranslationsothe

sequenceisoftheformT−1R−1SRT.

Themostsensibleplacetoputtheshearissecondsothattheinstance

transformationbecomesI=TRHS.Wecanseethatthisordermakes

senseifweconsideracubecenteredattheoriginwhosesidesarealigned

withtheaxes.Thescalegivesusthedesiredsizeandproportions.The

shearthenconvertstherightparallelepipedtoageneralparallelepiped.

Finallywecanorientth

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 小学教育 > 小升初

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1