Papervision3D & SoundMixer

Posted by – September 4, 2007


A quick example of direct manipulation of Papervision3D Vertices. It uses the current audio wave or spectrum to set the vertices’s y-axis value.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
var bytes:ByteArray; /* Holds the 512 bytes returned by computeSpectrum */
SoundMixer.computeSpectrum(bytes, true 0);
/* See the complete source code for the patched ShadedColorMaterial */
var shadedMaterial:ShadedColorMaterial = new ShadedColorMaterial(0xFFFF00);
 
var sphere:Sphere = new Sphere(shadedMaterial, 400, 32, 32);
 
rootNode.addChild(sphere);
 
for(var i:int = 0; i < 512; i++)
{
    sphere.geometry.vertices[i].y = -bytes[i] * 2;
}
scene3D.renderCamera(camera3D);

[Full Source Code]

0 Comments on Papervision3D & SoundMixer

Respond

Respond

Comments

Comments