Intro
A long term goal of ours has been to produce movies with Papervision. Our first attempt is “forever”. We created this movie by screen capturing a Wii controlled silly string application we had written. What we learned from our first creation was how powerful the Wii was as an animation tool in making 3D movies.
We are now working on our next movie called Harry.
The YouTube movie is below. My son Josh (the incredible guitar player) put together all the music.
YouTube Video
Scaled Down Non-Wii version
Click on the image or link below to view a scaled down non-Wii version of this application. Placing your mouse cursor on the right side of the screen causes the string to grow fat, on the left side skinny.
Or click on the link below;
http://www.professionalpapervision.com/demos/web/sillystring/
Downloads
You can download the Wii controlled Silly String program from
http://code.google.com/p/flex3cookbook2/downloads/list
there is also a scaled down web version you can download.
Wiimote Comands
For this particular demonstration we programmed the Wiimote keys as follows. Of course this will change depending on the application.
Press A = Increase Orbit Radius
Release A = Return Orbit Radius
Press B = Get Fat
Release B = Return Skinny
Press UP = Zoom Out
Release Down = Zoom In
Press + = Increase Velocity Release
Press – = Decrease Velocity
Press Home = Blow Up (Repeating Destroys More)
Creating the Disk
To create the Wii Disk shown below slow your velocity to zero by holding the “-” key. The silly string will wrap around itself creating the disk. Then play around by pressing the B key, the A key, and then blow it up using the home key.
Discussion
The heart of the Wii controlled silly string program is the line3D class and the Wii starter code provided in a previous post. Drawing a 3D line is really simple in Papervision. Just create a new line as shown below
new Line3D(lines, lineMaterial, lineSize, prevVertex3d, myVertexHere);
and give it a starting point and ending point as shown above. The string is then pushed forward by continually incrementing rotation (pitch, yaw, and roll) of the guiding sphere and using the moveForward command as shown below;
sphere.rotationX+=-(int(MyWiiIs.pitch*400)/100);
sphere.rotationY+=(int(MyWiiIs.yaw*400)/100);
sphere.rotationZ+=(int(MyWiiIs.roll*400)/100);
sphere.moveForward(forwardSpeed);
Finally, the string is constrained to a sphere by setting its last coordinates to the guiding sphere’s coordinates. The radius of the sphere constraint can be changed by changing the velocity of your string.
sphere.x=lines.x;
sphere.y=lines.y;
sphere.z=lines.z;
Click the more button below to see the entire code.


Posted by Mike Lively