NEONLIGHT
YaBB Newbies
Offline
Posts: 21
modify vertices in the box() method
Jun 9th , 2008, 3:52pm
is it possible to change the X/Y/Z position of some vertices of a drawn box? i want to change the position according to the incoming audio-volume to generate a distortion-effect. right now, i have my own shape class that looks something like this: (the points are saved in a Point3D array, another class of my own) beginShape(QUADS); // TOP vertex(pts[4].getX(), pts[4].getY(), pts[4].getZ()); vertex(pts[5].getX(), pts[5].getY(), pts[5].getZ()); vertex(pts[6].getX(), pts[6].getY(), pts[6].getZ()); vertex(pts[7].getX(), pts[7].getY(), pts[7].getZ()); // BOTTOM vertex(pts[0].getX(), pts[0].getY(), pts[0].getZ()); vertex(pts[1].getX(), pts[1].getY(), pts[1].getZ()); vertex(pts[2].getX(), pts[2].getY(), pts[2].getZ()); vertex(pts[3].getX(), pts[3].getY(), pts[3].getZ()); // FRONT vertex(pts[2].getX(), pts[2].getY(), pts[2].getZ()); vertex(pts[3].getX(), pts[3].getY(), pts[3].getZ()); vertex(pts[7].getX(), pts[7].getY(), pts[7].getZ()); vertex(pts[6].getX(), pts[6].getY(), pts[6].getZ()); // BACK vertex(pts[0].getX(), pts[0].getY(), pts[0].getZ()); vertex(pts[1].getX(), pts[1].getY(), pts[1].getZ()); vertex(pts[5].getX(), pts[5].getY(), pts[5].getZ()); vertex(pts[4].getX(), pts[4].getY(), pts[4].getZ()); // LEFT vertex(pts[0].getX(), pts[0].getY(), pts[0].getZ()); vertex(pts[3].getX(), pts[3].getY(), pts[3].getZ()); vertex(pts[7].getX(), pts[7].getY(), pts[7].getZ()); vertex(pts[4].getX(), pts[4].getY(), pts[4].getZ()); // RIGHT vertex(pts[1].getX(), pts[1].getY(), pts[1].getZ()); vertex(pts[2].getX(), pts[2].getY(), pts[2].getZ()); vertex(pts[6].getX(), pts[6].getY(), pts[6].getZ()); vertex(pts[5].getX(), pts[5].getY(), pts[5].getZ()); endShape(); it works - somehow. the floor-rectangle always shines through too bright. is there any way to change this effect? or does anyone know how the box method works inside? because that's exactly what i need.