ftt - cs.umd.edu · ftt Problem Worth t Short answer 120 2 Navigation and obstacles lL5 3 L-System...

9
1 CMSC425: Spring 2019 Midterm 2 Worth:lfi) This exam is closed book and closed notes with the exception of one sheet of notes. Please turn in the notes with the exam. you may use any algorithms or results given in class or in the Mount lecture notes. We do not expect proofs, but do expect you to support answers when asked' The boxes here are for Gradescope. Put your primary answer in each box. lf you have supporting comments, scratch work, or other, put it on other blank sections and we will be able to see and take it into account. lf a blank section is small is means the answer is short, but not the reverse' t ptedge on my honor thot t have not given or received any unauthorized assistonce on this exomination. ftt Problem Worth t Short answer 120 2 Navigation and obstacles lL5 3 L-System /20 4 Flocking and crowd motion lLs 5 Winged edge mesh rePresentation lLs 6 A{' /ts

Transcript of ftt - cs.umd.edu · ftt Problem Worth t Short answer 120 2 Navigation and obstacles lL5 3 L-System...

Page 1: ftt - cs.umd.edu · ftt Problem Worth t Short answer 120 2 Navigation and obstacles lL5 3 L-System /20 4 Flocking and crowd motion lLs 5 Winged edge mesh rePresentation lLs 6 A{'

1

CMSC425: Spring 2019

Midterm 2Worth:lfi)

This exam is closed book and closed notes with the exception of one sheet of notes. Please turnin the notes with the exam. you may use any algorithms or results given in class or in the Mount

lecture notes. We do not expect proofs, but do expect you to support answers when asked'

The boxes here are for Gradescope. Put your primary answer in each box. lf you have supporting

comments, scratch work, or other, put it on other blank sections and we will be able to see and

take it into account. lf a blank section is small is means the answer is short, but not the reverse'

t ptedge on my honor thot t have not given or received any unauthorized assistonce on this

exomination.

ftt

Problem Wortht Short answer 120

2 Navigation and obstacles lL5

3 L-System /20

4 Flocking and crowd motion lLs

5 Winged edge mesh rePresentation lLs

6 A{' /ts

Page 2: ftt - cs.umd.edu · ftt Problem Worth t Short answer 120 2 Navigation and obstacles lL5 3 L-System /20 4 Flocking and crowd motion lLs 5 Winged edge mesh rePresentation lLs 6 A{'

2

Problem 1. Short answer (20 pts, 3-4 each). Explanations are not needed, but may be given forpartial credit, or to insure we understand your answer.

a) Bump mopping. Bump mapping is : (put your answer in the box). CMapping street potholes b. Mapping mountain rangesa

c. Tweaking surface normals for texture d. Making fractal mountains

bl Perlin noise. Why do values of persistence between 0 and t help smooth Perlin noise?

c) Poth quality. Name two element other than distance mi

h$Y PEAra lt ,18 Lgationd/L

g navrpath q ua lity

dl Configuration space. How many degrees of freedom would the configuration space for tankthat can move forward in any direction and has a turret that can rotate and lift the canon?

el Cubic curves. lf you have a cubic curve with the equation p(t) = at3 + bt2 + ct * d and onepoint with position x0 and tangent dxo, what constraints on parameters a,b,c and d do you have?

Tlu, {'edv(e OLo-

al/^"*k b, 4sf/x

/- n^/(* [Jn"^ nao)

rorf ffirn{,irrl>-nt -/fis*l- /u- erua/c5{/ope,*5

) b-"-/.c .nK</

L>X(

o

-/A t, t-{,(*rA arn, l-,"l',

( oc7,//Lafn761e

PG\f' (o)

t' lt)j-(") + 261o)tc> (=Jro

= J = {O

3^ft2btrc

Page 3: ftt - cs.umd.edu · ftt Problem Worth t Short answer 120 2 Navigation and obstacles lL5 3 L-System /20 4 Flocking and crowd motion lLs 5 Winged edge mesh rePresentation lLs 6 A{'

3

Problem 2. Navigation and obstacles (15 pts).C-obstacles. Given the obstacle of the large diamond C in this diagramanswer the following:

Sketch below the C-obstacles that result from the moving shapes A and B.

Your sketches can be approximate. Use the centroid of each shape.a)With A b) With B

c) What difference would it make to shape and position of the C-obstacle if you use the rightcorner point on the square A instead of the centroid?

BA

/"

IIIIIIIIf-

IL--------I

IIIIIIII7IIII

III

f/-* {

(bfi*_ bNvP-olw frr^

t{ htdb.tln,vc-J

lm n€/{

J,ht

/"'{

Page 4: ftt - cs.umd.edu · ftt Problem Worth t Short answer 120 2 Navigation and obstacles lL5 3 L-System /20 4 Flocking and crowd motion lLs 5 Winged edge mesh rePresentation lLs 6 A{'

4

Problem 3. L'system (20 points). Given this diagram of recursive step of a possible L-systemcurve, with the initiator on the left and the next step on the right, answer the questions below.

a) Give an L-system with'grammar for drawing the shape defined by the curve?

b) Give the fractal dimension of the curve

qL=/{f 2 +Fr-F--f trt=++FF-

0L , ( f* /,rrt + ./vJ /.sl4 mt{5,5 , {A'ud L'r'- F->

-

# o/ llaas ll -- 6fc-L /..b *iG 5o ?=V ,

)

/o7\ t5 t, h

kst0

ruz

Page 5: ftt - cs.umd.edu · ftt Problem Worth t Short answer 120 2 Navigation and obstacles lL5 3 L-System /20 4 Flocking and crowd motion lLs 5 Winged edge mesh rePresentation lLs 6 A{'

5

problem 4. Flocking and crowd motion (15 points). Let's assume you have game with a NPC wolfpack that chases the player, and the wolf pack exhibits flocking behavior. lt stays together, but

can separate to go around an obstacle

a) Describe at least three forces you'd apply to each wolf'

b) One way to insure two wolves do not collide is to compute a forbidden region of velocities for

each pair of wolves based on their current velocities. li you have tWo wolves a and b in 2d space

like on the left, how do you compute a forbiddeh region of velooities for a if b is static?

T6

,,@ ut-"

@

5e7er</,\ ' 6-vo,J cr/f tfu,n-< wl botb*{r*r,*-r(- i h* ,v^* lro<5--.-CV u,J aLQ- a 6-vt,td (r/ (,S,ev; wf ohS)

1ak)a,r^|\ - * 716-77.*4

A-7 (,/ H6,

It f a+t(q-/tl[ 1L+ru

\ tg)d)

,/*Cr-.

e

/roS tre /oc'

af A- <s,*fo* {a

\;Q*

Wa hs*

Page 6: ftt - cs.umd.edu · ftt Problem Worth t Short answer 120 2 Navigation and obstacles lL5 3 L-System /20 4 Flocking and crowd motion lLs 5 Winged edge mesh rePresentation lLs 6 A{'

6

Problem 5. Winged edge mesh representation (20 points).The DECL representation is given on the right. Given this, answerthe questions below.First: give short expressions to give:

e the face on e's side

b) e.onext: the next half-edge that shares e's origin that comesafter e in ccw order

c) Give an a rithm to the t face of e in ccw order

d) Give an algorithm to give all the vertices adjacent to e.org in any order.

twin""".e.org

L.J'*ta, t" t''te.Prev

next

Q / n, 1"" t4

64."t c(zrCctrf = qmf, flAF'f( c<-rn { = <.*-,n )wlr,U-

_3{Aot ,4vrffted5as >

Cury'= e.-*ytndp{

d,,dnTrvt Cc,vf, olx rrC czf f ? Cc./ f Y',t* tA t ,.-a..ir*

Ivh'b ( c''t' '/= e')

,* Sl& 3sCo4rr = Q og'q

Page 7: ftt - cs.umd.edu · ftt Problem Worth t Short answer 120 2 Navigation and obstacles lL5 3 L-System /20 4 Flocking and crowd motion lLs 5 Winged edge mesh rePresentation lLs 6 A{'

7

problem O. A* (15 points). Assume a Manhattan-like arena with all the obstacles square blocks in

a regular pattern, strictly bounded on the outside, like the diagram below. Most blocks have unit

cost, but some have INF cost (full obstacles) and some have other costs (like water or forest)

which are given in the diagram below.

3

Dr-;l 3 c 3

Ill

4

I

r

B

2 A

t.l

.,,.{

a) Would the Eucheuristic? Why?

lideandistancessqrt((x1-x2|^2+(y!.y2)^2)betweentwoblocksbeanadmissible.'i'j{

b) Would the Manhattarid'istance abs(x1-x2)+abs(y1-y2) between two blocks be an admissible

heuristic? Why?

a

l/c rlb/)*It

' t 19

[vc(tJe-* AfJ>4La- 6 brr n@',,\

,,rL"i ; t+,-^ (1 a5"a 4 bL*krr fb4, 7'Ar ")S f-fu'o"'-

1or&.

(affs {o rr brf n'-"-Trok C6,f(-r.

/crk- J;-or1o-,n

Va{k; ,n5

Page 8: ftt - cs.umd.edu · ftt Problem Worth t Short answer 120 2 Navigation and obstacles lL5 3 L-System /20 4 Flocking and crowd motion lLs 5 Winged edge mesh rePresentation lLs 6 A{'

8

Problem 6. continued

Given the data in the diagram above, show the result ofA* from S to T using the Mahattandistance heuristic.

73 4/o ot3 qa:to N:3 frrL N,7Mi7

I0:B

rL ?-loj.'7

l2: 6b++31,

At, 6

v 1:6 6

12,3 q LLlz

s

fS k C D //

trfu)

btl @r O

1.5

2.4

3Bilfl.e

t.

6C lf:o

7r L

Page 9: ftt - cs.umd.edu · ftt Problem Worth t Short answer 120 2 Navigation and obstacles lL5 3 L-System /20 4 Flocking and crowd motion lLs 5 Winged edge mesh rePresentation lLs 6 A{'

10

Scratch paperlf you want us to check anything here please make a note at the original question