The example basically rotated an image around. when the mouse went past the half way point the image was swapped.
void iterateParticle(float fkx) {
// iterate for a single force acting on the particle
pfx = fkx;
pa2 = pfx*pfx ;
if (pa2 < 0.0000001) {
return;
}
pax = pfx/pMass;
pvx += pax;
pv2 = pvx*pvx ;
if (pv2 < 0.0000001) {
return;
}
pvx *= (1.0 - pDrag);
px += pvx;
}
Above is the 'iterateParticle' bit that controls the speed of movement as the cursor is moved left to right over the image.
void drawShoe(float x)
{
float depth =width/4;
background(0);
translate(width / 2, height / 2);
//rotateY(x);
rotateY(map(x, 0, width,0, PI));
//rotateZ(PI/6);
beginShape();
texture(img);
vertex(-(width/2), -(height/2), 0, 0, 0);
vertex((width/2), -(height/2), 0, width, 0);
vertex((width/2), (height/2), 0, width, width);
vertex(-(width/2), (height/2), 0, 0, width);
endShape();
}
The drawShoe function draws the shoe and rotates it according to the x position which is actually the cursor position on the image.
In the main body of the program as the cursor moves over the centre point it changes to a different image of a shoe. This works well and although its very basic its given me ideas i want to try out. Its a long way off but it would be interesting to try web cam stuff even though Seb has said that its a long way off just swaping the mouse for motion detection. i think more exploring is needed.


