We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › question about applying video to moving objects.
Page Index Toggle Pages: 1
question about applying video to moving objects. (Read 415 times)
question about applying video to moving objects.
Oct 29th, 2005, 4:25am
 
i've got a rectangle that's rotating. i want to apply some live video to it, but don't seem to be using fill() correctly. anyone think of a way to fill the rotating box with the being-captured movie?
Re: question about applying video to moving object
Reply #1 - Oct 29th, 2005, 9:17am
 
something like this?
Code:

void drawCube(int ox, int oy, int ow, int oh, PImage otex){
beginShape(QUADS);
texture(otex);
vertex(ox ,oy ,0 ,0,0);
vertex(ox+ow,oy ,0 ,otex.width,0);
vertex(ox+ow,oy+oh,0 ,otex.width,otex.height);
vertex(ox ,oy+oh,0 ,0,otex.height);

vertex(ox ,oy ,0 ,0,0);
vertex(ox+ow,oy ,0 ,otex.width,0);
vertex(ox+ow,oy ,oh,otex.width,otex.height);
vertex(ox ,oy ,oh,0,otex.height);

vertex(ox+ow,oy ,0 ,0,0);
vertex(ox+ow,oy+oh,0 ,otex.width,0);
vertex(ox+ow,oy+oh,oh,otex.width,otex.height);
vertex(ox+ow,oy ,oh,0,otex.height);

vertex(ox+ow,oy+oh,0 ,0,0);
vertex(ox ,oy+oh,0 ,otex.width,0);
vertex(ox ,oy+oh,oh,otex.width,otex.height);
vertex(ox+ow,oy+oh,oh,0,otex.height);

vertex(ox ,oy ,0 ,0,0);
vertex(ox ,oy+oh,0 ,otex.width,0);
vertex(ox ,oy+oh,oh,otex.width,otex.height);
vertex(ox ,oy ,oh,0,otex.height);

vertex(ox ,oy ,oh,0,0);
vertex(ox+ow,oy ,oh,otex.width,0);
vertex(ox+ow,oy+oh,oh,otex.width,otex.height);
vertex(ox ,oy+oh,oh,0,otex.height);

endShape();
}

you might need to change some things, since i used static z and depth values.

usage:
Code:

void draw()
{
drawCube(xpos,ypos,width,height,movieImage);
}


-seltar
Page Index Toggle Pages: 1