Java Code Examples for processing.opengl.PGraphics3D#pushMatrix()

The following examples show how to use processing.opengl.PGraphics3D#pushMatrix() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Skylight_BulletPhysics_Cubes.java    From PixelFlow with MIT License 6 votes vote down vote up
public void displayScene(PGraphics3D pg){
  if(pg == skylight.renderer.pg_render){
    pg.background(16);
  }
  
  if(pg == geombuffer.pg_geom){
    pg.background(255, 255);
    pg.pgl.clearColor(1, 1, 1, 6000);
    pg.pgl.clear(PGL.COLOR_BUFFER_BIT);
  }
  
  pg.pushMatrix();
  pg.applyMatrix(mat_scene_view);
  pg.shape(group_bulletbodies);
  pg.popMatrix();
}
 
Example 2
Source File: Skylight_BulletPhysics_CellFracture.java    From PixelFlow with MIT License 6 votes vote down vote up
public void displayScene(PGraphics3D pg){
  if(pg == skylight.renderer.pg_render){
    pg.background(16);
  }
  
  if(pg == geombuffer.pg_geom){
    pg.background(255, 255);
    pg.pgl.clearColor(1, 1, 1, 6000);
    pg.pgl.clear(PGL.COLOR_BUFFER_BIT);
  }
  
  pg.pushMatrix();
  pg.applyMatrix(mat_scene_view);
  pg.shape(group_bulletbodies);
  pg.popMatrix();
}
 
Example 3
Source File: Skylight_BulletPhysics_MengerSponge.java    From PixelFlow with MIT License 6 votes vote down vote up
public void displayScene(PGraphics3D pg){
  if(pg == skylight.renderer.pg_render){
    pg.background(180);
  }
  
  if(pg == geombuffer.pg_geom){
    pg.background(255, 255);
    pg.pgl.clearColor(1, 1, 1, 6000);
    pg.pgl.clear(PGL.COLOR_BUFFER_BIT);
  }
  
  pg.pushMatrix();
  pg.applyMatrix(mat_scene_view);
  pg.shape(group_bulletbodies);
  pg.popMatrix();
}
 
Example 4
Source File: Skylight_Capture1.java    From PixelFlow with MIT License 6 votes vote down vote up
public void displayScene(PGraphics3D canvas){
    if(canvas == skylight.renderer.pg_render){
      canvas.background(16);
      displaySamples(canvas);
    }
    
    // ground plane
    float sx = bounds[3] - bounds[0];
    float sy = bounds[4] - bounds[1];
    float sz = bounds[5] - bounds[2];

    canvas.pushMatrix();
    canvas.translate(0, 0, 20 + sz/2);
    canvas.rotateX(-PI/2);
    canvas.shape(group_cubes);
    canvas.popMatrix();

    
    canvas.noStroke();
    canvas.fill(16,64,180);
//    canvas.fill(180,120,64);
//    canvas.box(sx*1.5f, sy*1.5f, 10);
    canvas.box(sx, sy, 10);
  }
 
Example 5
Source File: Skylight_Capture.java    From PixelFlow with MIT License 6 votes vote down vote up
public void displayScene(PGraphics3D canvas){
  if(canvas == skylight.renderer.pg_render){
    canvas.background(BACKGROUND_COLOR);
  }

  // draw shapes
  canvas.pushMatrix();
  canvas.translate(0, 0, cube_size + cube_size * cube_numy /2 + 50);
  canvas.rotateX(-PI/2);
  if(group_cubes != null){
    canvas.shape(group_cubes);
  }
  canvas.popMatrix();
  
  // draw ground plane
  float sx = scene_bounds[3] - scene_bounds[0];
  float sy = scene_bounds[4] - scene_bounds[1];
  canvas.noStroke();
  canvas.fill(255);
  canvas.ellipse(0,0, sx * SQRT2, sy * SQRT2);
}
 
Example 6
Source File: Skylight_Movie.java    From PixelFlow with MIT License 6 votes vote down vote up
public void displayScene(PGraphics3D canvas){
  if(canvas == skylight.renderer.pg_render){
    canvas.background(BACKGROUND_COLOR);
  }

  // draw shapes
  canvas.pushMatrix();
  canvas.translate(0, 0, cube_size + cube_size * cube_numy /2);
  canvas.rotateX(-PI/2);
  canvas.shape(group_cubes);
  canvas.popMatrix();
  
  // draw ground plane
  float sx = scene_bounds[3] - scene_bounds[0];
  float sy = scene_bounds[4] - scene_bounds[1];
  canvas.noStroke();
  canvas.fill(255);
  canvas.ellipse(0,0, sx * SQRT2, sy * SQRT2);
}
 
Example 7
Source File: Skylight_BulletPhysics_Breakable.java    From PixelFlow with MIT License 6 votes vote down vote up
public void displayScene(PGraphics3D pg){
  if(pg == skylight.renderer.pg_render){
    pg.background(16);
  }
  
  if(pg == geombuffer.pg_geom){
    pg.background(255, 255);
    pg.pgl.clearColor(1, 1, 1, 6000);
    pg.pgl.clear(PGL.COLOR_BUFFER_BIT);
  }
  
  pg.pushMatrix();
  pg.applyMatrix(mat_scene_view);
  pg.shape(group_bulletbodies);
  pg.popMatrix();
}
 
Example 8
Source File: Skylight_BulletPhysics_Breakable_VideoExport.java    From PixelFlow with MIT License 6 votes vote down vote up
public void displayScene(PGraphics3D pg){
  if(pg == skylight.renderer.pg_render){
    pg.background(16);
  }
  
  if(pg == geombuffer.pg_geom){
    pg.background(255, 255);
    pg.pgl.clearColor(1, 1, 1, 6000);
    pg.pgl.clear(PGL.COLOR_BUFFER_BIT);
  }
  
  pg.pushMatrix();
  pg.applyMatrix(mat_scene_view);
  pg.shape(group_bulletbodies);
  pg.popMatrix();
}
 
Example 9
Source File: Skylight_BulletPhysics_Breakable3.java    From PixelFlow with MIT License 6 votes vote down vote up
public void displayScene(PGraphics3D pg){
  if(pg == skylight.renderer.pg_render){
    pg.background(16);
  }
  
  if(pg == geombuffer.pg_geom){
    pg.background(255, 255);
    pg.pgl.clearColor(1, 1, 1, 6000);
    pg.pgl.clear(PGL.COLOR_BUFFER_BIT);
  }
  
  pg.pushMatrix();
  pg.applyMatrix(mat_scene_view);
  pg.shape(group_bulletbodies);
  pg.shape(group_collisions);
  pg.popMatrix();
}
 
Example 10
Source File: Skylight_BulletPhysics_TowerDemolition.java    From PixelFlow with MIT License 6 votes vote down vote up
public void displayScene(PGraphics3D pg){
  if(pg == skylight.renderer.pg_render){
    pg.background(16);
  }
  
  if(pg == geombuffer.pg_geom){
    pg.background(255, 255);
    pg.pgl.clearColor(1, 1, 1, 6000);
    pg.pgl.clear(PGL.COLOR_BUFFER_BIT);
  }
  
  pg.pushMatrix();
  pg.applyMatrix(mat_scene_view);
  pg.shape(group_bulletbodies);
  pg.popMatrix();
}
 
Example 11
Source File: Skylight_BulletPhysics_Basic.java    From PixelFlow with MIT License 6 votes vote down vote up
public void displayScene(PGraphics3D pg){
  if(pg == skylight.renderer.pg_render){
    pg.background(16);
  }
  
  if(pg == geombuffer.pg_geom){
    pg.background(255, 255);
    pg.pgl.clearColor(1, 1, 1, 6000);
    pg.pgl.clear(PGL.COLOR_BUFFER_BIT);
  }
  
  pg.pushMatrix();
  pg.applyMatrix(mat_scene_view);
  pg.shape(group_bulletbodies);
  pg.popMatrix();
}
 
Example 12
Source File: Skylight_Movie3.java    From PixelFlow with MIT License 5 votes vote down vote up
public void displayScene(PGraphics3D canvas){
    if(canvas == skylight.renderer.pg_render){
      canvas.background(255);
    }
    
    // ground plane
    float sx = bounds[3] - bounds[0];
    float sy = bounds[4] - bounds[1];
    float sz = bounds[5] - bounds[2];
    
//    sx *= 2;
//    sy *= 2;
    canvas.pushMatrix();
    canvas.translate(0, 0, cube_size + cube_size * cube_numy /2);
    canvas.rotateX(-PI/2);
    canvas.shape(group_cubes);
    canvas.popMatrix();

//    canvas.beginShape(QUAD);
//    canvas.texture(pg_src);
//    canvas.textureMode(NORMAL);
//    canvas.vertex(bounds[0], bounds[1], 20, 0,0);
//    canvas.vertex(bounds[3], bounds[1], 20, 1,0);
//    canvas.vertex(bounds[3], bounds[4], 20, 1,1);
//    canvas.vertex(bounds[0], bounds[4], 20, 0,1);
//    canvas.endShape();
    
    canvas.noStroke();
    
    canvas.fill(255);
//    canvas.fill(16,64,255);
//    canvas.fill(96,160,255);
//    canvas.fill(180,120,64);
//    canvas.fill(255,180,128);
//    canvas.box(sx*1.5f, sy*1.5f, 10);
//    canvas.box(sx, sy, 10);
    
//    canvas.rect(-sx/2, -sy/2, sx, sy);
    canvas.ellipse(0,0, sx * SQRT2, sy * SQRT2);
  }