
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); |