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