Katie Bora Math 198 December 15, 2014 Goal: To create a fencer - - PowerPoint PPT Presentation

katie bora
SMART_READER_LITE
LIVE PREVIEW

Katie Bora Math 198 December 15, 2014 Goal: To create a fencer - - PowerPoint PPT Presentation

Katie Bora Math 198 December 15, 2014 Goal: To create a fencer performing the Advance Lunge and hitting an opponent. Then, the fencer will retreat backwards. The opponent will remain stationary. Use VPython En Garde Advance


slide-1
SLIDE 1

Katie Bora Math 198 December 15, 2014

slide-2
SLIDE 2

Goal: To create a fencer performing

the Advance Lunge and hitting an

  • pponent. Then, the fencer will

retreat backwards. The opponent will remain stationary.

Use VPython

slide-3
SLIDE 3

En Garde Advance Lunge Retreat

slide-4
SLIDE 4
slide-5
SLIDE 5
slide-6
SLIDE 6
slide-7
SLIDE 7

First, created the frames Then, put objects within the frames Frames review-hierarchy, top down

process

slide-8
SLIDE 8
slide-9
SLIDE 9
slide-10
SLIDE 10
slide-11
SLIDE 11

 fheart=frame()  fhead=frame(frame=fheart, pos=(0,1.75,0))  ftorso=frame(frame=fheart, pos=(0,.75,0))  fwaist=frame(frame=ftorso, pos=(0,-2.5,0))  fshoulderL=frame(frame=ftorso,

pos=(-sqrt(2)/2,-.75,sqrt(2)/2))

 felbowL=frame(frame=fshoulderL,

pos=(-.6,-2,0))

 fwristL=frame(frame=felbowL, pos=(-.1,-2,0))

slide-12
SLIDE 12

Instead of rotating the body, I

changed the positions of the frames to have the fencer start out in En Garde.

slide-13
SLIDE 13
slide-14
SLIDE 14
slide-15
SLIDE 15

fwaist.rotate(angle = ((pi/4)/5.4), axis = (0,1,0)) fshoulderL.rotate(angle = (-5*pi/4)/54, axis = (0,0,1)) fshoulderR.rotate(angle = (pi/4)/5.4, axis = (0,0,1)) felbowR.rotate(angle= (-pi/2)/5.4, axis = (0,0,1)) fweaponR.rotate(angle= (pi/4)/5.4, axis = (0,0,1)) fhipL.rotate(angle= (-pi/2)/5.4, axis=(-1,-1,1)) fkneeL.rotate(angle = (pi/3)/5.4, axis=(0,0,1)) fhipR.rotate(angle=(-pi/2)/5.4, axis=(1.5,0,0)) fkneeR.rotate(angle=(pi/2)/5.4, axis=(1.5,0,0))

slide-16
SLIDE 16
slide-17
SLIDE 17
slide-18
SLIDE 18

def lunge(j): for i in range (1,400,1): angle = math.radians(i) print i if 0 < i < 5.4: rate(10)

slide-19
SLIDE 19

Horizontal Translation def advance(j):

fheart.pos.x+=j

Call the function within the Lunge

rotation.

slide-20
SLIDE 20

fweaponR.rotate(angle= (pi/4)/5.4, axis = (0,0,1)) advance(1) fhipL.rotate(angle= (-pi/2)/5.4, axis=(-1,-1,1))

slide-21
SLIDE 21

Horizontal Translation def backwards(j):

dir=1 fheart.pos.x-=dir

slide-22
SLIDE 22

Reverse the Lunge Same code, but with opposite angles Instead of going from top down, move

from down up.

Also call the backwards function

within the retreat lunge.

slide-23
SLIDE 23

Created a second wire frame Shifted the head and torso by 15 in the x

direction fheart2=frame() fhead2=frame(frame=fheart2,pos=(15,1.75,0)) ftorso2=frame(frame=fheart2,pos=(15,.75,0)) fwaist2=frame(frame=ftorso2, pos=(0,2.5,0))

slide-24
SLIDE 24

Rotated torso by pi to turn the

  • pponent to face the moving fencer.

ftorso2.rotate(angle =(pi), axis = (0,1,0))

Changed “sock” colors

slide-25
SLIDE 25
slide-26
SLIDE 26

Fencing animation does not start until

any key on the key board is pressed

After the frames and objects for body

1 and 2, add the following: scene.waitfor('keydown') # wait for keyboard key press

slide-27
SLIDE 27
slide-28
SLIDE 28

Have the opponent retreat and then

parry riposte

Can demonstrate other fencing moves:

  • Feint
  • Fleche
  • Beat

Create a virtual fencing bout Add in the strip