wandPosition Examples: Throwing Paper Airplanes
This example uses the wand position as the start point for an animation. Whenever you press button 1, a paper airplane launches from your hand.
/* throwing a paper airplane using the wandPosition node when button 1 is pressed, move the airplane to the wand's position and start the animation to make it fly. */ #include "User0" light ( (1 -1 1)) light ( (-1 -1 -1),(.5 .5 .5)) wandPosition((infinite), when(button1,flightStartPoint.($xpos $ypos $zpos), flightTimer.)) timer flightTimer ((10),when(changed,flightpath.($value))) transform flightStartPoint () { pointFollower flightpath ((flight.)) { object ((paperairplane.b3d)) } }
The path file, flight.path:
0 0 0 5 5 10 3 10 8 -5 15 5 0 20 0
(c) Ben Chang