More Exercises
Exercise: Modify the vertices of "box" below to make a "lightpole" with the unit square as base and 3 units high. This can be done by modifying the following instructions.
>
v1:=[.5,0,0]: v2:=[.5,.5,0]: v3:=[.5,.5,3]: v4:=[.5,0,3]:
v5:=[0,0,0]: v6:=[0,.5,0]: v7:=[0,.5,3]: v8:=[0,0,3]:
front := [v1,v2,v3,v4]: back := [v5,v6,v7,v8]:
left := [v1,v5,v8,v4]: right := [v2,v6,v7,v3]:
top := [v4,v3,v7,v8]: bottom := [v1,v2,v6,v5]:
pole := plots[polygonplot3d]([front,back,left,right,top,bottom],style=patch,color=tan,scaling=constrained):
>
Exercise: Use plottool[sphere] to place a light on top of the pole in the form of a sphere one unit in diameter.
>
Exercise: Place the lightpole on a rectangular area according to the diagram.
DIAGRAM CODE
>
base:=plots[polygonplot]([ [-.5,-.5], [ .5,-.5], [ .5,.5], [-.5,.5]], style=patch,color=tan, scaling=constrained): ground:=plots[polygonplot]([[ -5,-5 ],[ 10,-5 ],[ 10, 5 ],[ -5, 5 ]],color=green, style=patch ):
plots[display]([base, ground],scaling=constrained);
>
>
>
GROUND PLACEMENT
>
light:=plottools[sphere]( [.5,.5,4], 1, color=red,style=patchnogrid):
ground:=plots[polygonplot3d]([[ -5,-5,0],[ 10,-5,0],[ 10, 5,0],[ -5, 5,0]],color=green, style=patch ):
>
>
Exercise: Errect a wall 10 units from the light pole which is ten units high, as indicated in the diagram
Wall Placement
> wall:=plots[polygonplot3d]([[ 10, -5, 0],[ 10,-5,10],[ 10, 5,10],[ 10, 5,0]],color=blue, style=wireframe,thickness=2):
> plots[display]([light,ground,pole,wall ]);
>
> plots[display]([light,ground,pole,wall,stickperson]);
Exercise: Place a "stickperson" 5.5 units high midway between the light and the wall. The stickperson is assumed to be two dimensional and to lie entirely in a plane parallel to the wall and perpendicular to the ground. The diagram below provides a sketch of "stickperson". From it one can derive coordinates for the face, body, legs, hands, and arms.
PARTIAL STICKPERSON
Make individual polygonplot3d plots for stickperson's various components and display stickperson
>
leftleg:=[[ 5,-1,0],[ 5,0,2]]:
Leftleg:=plots[polygonplot3d]( leftleg,style=wireframe, color=orange, thickness=3):
>
>
body:=[[ 5,0,2],[ 5,0,3.5]]:
Body:=plots[polygonplot3d](body,style=wireframe, color=red, thickness=3):
>
>
leftarm:=[[ 5,0,3],[ 5,-2,3]]:
Leftarm:=plots[polygonplot3d](leftarm,style=wireframe, color=purple, thickness=3):
>
> partialstickperson:=plots[display]([Leftarm, Body,Leftleg]):
>
>
Exercise: Assume that all of the light from the globe emits from the center of the light source and determine stickperson's shadow and add it to the picture. Note that the shadow will consist of two parts - the part on the ground and the part on the wall.
Exercise: Make an animation in which the light moves toward stickman. Make the shadow move appropriately.
Exercise: Put a flag in stickman's hand and extend the shadow to include the flag.
Exercise: Animate stickman to the extent that he/she waves the flag, extend the animation to include the flag shadow.
Exercise: Make stickperson's head a (three dimensional) cube and extend the shadow.