FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   texture mapping
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: texture mapping  (Read 400 times)
xhsun


texture mapping
« on: Oct 15th, 2004, 4:49am »

is there a way to do texture mapping in processing? i saw one previous thread mentioned about mapping a world map to a sphere, but unfortunetly the link provided is broken now.  
 
could anyone help me with this?
 
thanks
genr
 
 
elout

12747371274737 WWW
Re: texture mapping
« Reply #1 on: Oct 15th, 2004, 3:50pm »

something like this..
 
Code:

BImage a;
 
void setup()  
{
  size(550,550);
  //a 200*200px image - in your data folder.
  a = loadImage("florence03.jpg");  
}
void loop()  
{
 
  translate(width/2, height/2, mouseY);
  rotateX(mouseX/10.0);  
  rotateY(mouseY/10.0);  
  rotateZ(mouseY-mouseX/10.0);  
   
  beginShape(QUADS);  
   texture(a);  
   vertex(0,0,0,  0,0); //x,y,z , texture x, texture y
   vertex(100,0,0,  200,0);
   vertex(100,100,0,  200,200);
   vertex(0,100,0,  0,200);
  endShape();
}  
 
xhsun


Re: texture mapping
« Reply #2 on: Oct 15th, 2004, 8:33pm »

that's great, thank you very much for your help! one more question, besides within beginShape endShape, is there any other place i can use texture()? what will be a good way to texture circle, ellipse, curved shapes, or sphere? do i need to manually triangulate them to triangles or triangle strips?
 
thanks.
 
genr
 
Pages: 1 

« Previous topic | Next topic »