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

The following examples show how to use processing.opengl.PGraphics3D#noStroke() . 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_PoissonSphereSamples.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);
  }

  canvas.shape(shp_samples_spheres);
  
  // ground plane
  float sx = bounds[3] - bounds[0];
  float sy = bounds[4] - bounds[1];
  float sz = bounds[5] - bounds[2];
  
  canvas.noStroke();
  canvas.fill(16,64,180);
  canvas.box(sx*1.5f, sy*1.5f, 10);
}
 
Example 2
Source File: Skylight_Cubes.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);
    }

    canvas.shape(group_cubes);
    
    // ground plane
    float sx = bounds[3] - bounds[0];
    float sy = bounds[4] - bounds[1];
    float sz = bounds[5] - bounds[2];
    
    canvas.noStroke();
    canvas.fill(16,64,180);
//    canvas.box(sx*1.5f, sy*1.5f, 10);
    canvas.box(sx, sy, 10);
  }
 
Example 3
Source File: Skylight_Movie2.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);
    }

    canvas.shape(group_cubes);
    
    // ground plane
    float sx = bounds[3] - bounds[0];
    float sy = bounds[4] - bounds[1];
    float sz = bounds[5] - bounds[2];
    
    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 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_Movie1.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);
    }

    canvas.shape(group_cubes);
    
    // ground plane
    float sx = bounds[3] - bounds[0];
    float sy = bounds[4] - bounds[1];
    float sz = bounds[5] - bounds[2];
    
    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 6
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 7
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 8
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);
  }
 
Example 9
Source File: DwSkyLightShader.java    From PixelFlow with MIT License 4 votes vote down vote up
public void updateStep(){
    
    if(param.intensity <= 0){
      return;
    }
    
    if(shadowmap.pg_shadowmap.width != param.shadowmap_size){
      shadowmap.resize(param.shadowmap_size);
    }
    

    // 1) shadow pass
    generateSampleDirection();
    shadowmap.update();
    
    PGraphics3D pg_dst = getDst();
    PGraphics3D pg_src = getSrc();
    
    float w = pg_dst.width;
    float h = pg_dst.height;
    
    // 2.1) render pass
    pg_dst.beginDraw();
    pg_dst.blendMode(PConstants.REPLACE);
    pg_dst.shader(shader);
    setUniforms();
    shader.set("wh"            , w, h);
    shader.set("tex_src"       , pg_src);
    shader.set("tex_shadow"    , shadowmap.pg_shadowmap);
    shader.set("tex_geombuffer", geombuffer.pg_geom);
    pg_dst.resetMatrix();
    pg_dst.resetProjection();
    pg_dst.noStroke();
    pg_dst.fill(255);
    pg_dst.rect(-1,-1,2,2);
    pg_dst.endDraw();
    DwUtils.swap(pg_shading);
    
    
//    Texture tex_shadowmap = shadowmap.pg_shadowmap.getTexture();
//    Texture tex_geombuffer = geombuffer.pg_geom.getTexture();
//
//    context.begin();
//    context.beginDraw(tex_shading.dst);
//    shader_.begin();
//    setUniforms();
//    shader_.uniform2f     ("wh"            , w, h);
//    shader_.uniformTexture("tex_src"       , tex_shading.src);
//    shader_.uniformTexture("tex_shadow"    , tex_shadowmap.glName);
//    shader_.uniformTexture("tex_geombuffer", tex_geombuffer.glName);
//    shader_.drawFullScreenQuad();
//    shader_.end();
//    context.endDraw();
//    context.end();
//    
//    tex_shading.swap();
//    
//    DwFilter.get(context).copy.apply(tex_shading.src, pg_src);


    RENDER_PASS++;
  }