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)
   3d jpeg?...
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: 3d jpeg?...  (Read 728 times)
harbour

WWW
3d jpeg?...
« on: Feb 27th, 2005, 4:40am »

Any simple ideas how to rotate a jpg in 3d... do i need to do it using the pixel array and some complex run through of them or is there a simple way i'm missing...
 
any help appreciated.
 

harbour.em411.com
fjen

WWW
Re: 3d jpeg?...
« Reply #1 on: Feb 27th, 2005, 8:29am »

use a quad and a texture ...
 
Code:
BImage img;
 
void setup() {
  size(200,200);
  img = loadImage("house.jpg");
}
 
float rotation = 0.0;
 
void loop(){
  background(0);
  int xm = width;
  int ym = height;
   
  translate(width/2.0, height/2.0);
  rotateX(rotation);
  rotation += 0.02;
 
  beginShape(QUADS);
   texture(img);  
   vertex(-(xm/2),-(ym/2),0,  0,0);  // 0,0
   vertex((xm/2),-(ym/2),0,  176,0);  //img.width, 0
   vertex((xm/2),(ym/2),0,  176,144);  //img.width, img.height
   vertex(-(xm/2),(ym/2),0,  0,144); //0, img.height
 endShape();
}

 
/F
 
harbour

WWW
Re: 3d jpeg?...
« Reply #2 on: Feb 28th, 2005, 5:47am »

my hero...
 

harbour.em411.com
Pages: 1 

« Previous topic | Next topic »