how to draw a box (just a frame ) the frame bulit by boxes in 3D processing?

edited July 2015 in How To...

how to draw a box (just a frame ) in 3D processing? the box is (20,20,20)

Tagged:

Answers

  • Show your code

    Look at reference box

    Use noFill();

  • i want the frame made with boxes

  • edited July 2015
    size(440,440,P3D);
    smooth();
    background(0);
    translate(width/2,height/2);
    stroke(255);
    noFill();
    rotateX(1);
    rotateY(1);
    box(20,20,20);
    
  • TFGuy44 i know this ! i mean the frame by boxes not lines !

  • Answer ✓
    void setup(){
      size(440,440,P3D);
      smooth();
    }
    
    void draw(){
      background(0);
      translate(width/2,height/2);
      pushMatrix();
      scale(60);
      lights();
      popMatrix();
      scale(3);
      rotateY(map(mouseX,0,width,-PI,PI));
      rotateX(map(mouseY,0,height,-PI,PI));
      noStroke();
      fill(255,0,0);
      for(int x=-1;x<2;x++){
        for(int y=-1;y<2;y++){
          for(int z=-1;z<2;z++){
            if((x==0?1:0)+(y==0?1:0)+(z==0?1:0)<2){
              pushMatrix();
              translate(20*x,20*y,20*z);
              box(20,20,20);
              popMatrix();
            }
          }
        }
      }
    }
    
  • Thank you TFGuy44 thats it .

  • edited July 2015

    thanks again

Sign In or Register to comment.