Java Code Examples for processing.opengl.PGraphics3D#shape()
The following examples show how to use
processing.opengl.PGraphics3D#shape() .
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_Capture.java From PixelFlow with MIT License | 6 votes |
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 2
Source File: Skylight_BulletPhysics_Basic.java From PixelFlow with MIT License | 6 votes |
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_TowerDemolition.java From PixelFlow with MIT License | 6 votes |
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 4
Source File: Skylight_BulletPhysics_Breakable3.java From PixelFlow with MIT License | 6 votes |
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 5
Source File: Skylight_BulletPhysics_Breakable_VideoExport.java From PixelFlow with MIT License | 6 votes |
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 6
Source File: Skylight_BulletPhysics_Breakable.java From PixelFlow with MIT License | 6 votes |
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 7
Source File: Skylight_ClothSimulation.java From PixelFlow with MIT License | 6 votes |
public void displayGridXY(PGraphics3D canvas, int lines, float s){ if(shp_gridxy == null){ shp_gridxy = createShape(); shp_gridxy.beginShape(LINES); shp_gridxy.stroke(0); shp_gridxy.strokeWeight(0.3f); float d = lines*s; for(int i = 0; i <= lines; i++){ shp_gridxy.vertex(-d,-i*s,0); shp_gridxy.vertex(d,-i*s,0); shp_gridxy.vertex(-d,+i*s,0); shp_gridxy.vertex(d,+i*s,0); shp_gridxy.vertex(-i*s,-d,0); shp_gridxy.vertex(-i*s,d,0); shp_gridxy.vertex(+i*s,-d,0); shp_gridxy.vertex(+i*s,d,0); } shp_gridxy.endShape(); } canvas.shape(shp_gridxy); }
Example 8
Source File: Skylight_Movie.java From PixelFlow with MIT License | 6 votes |
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 9
Source File: Skylight_Movie1.java From PixelFlow with MIT License | 6 votes |
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 10
Source File: Skylight_Capture1.java From PixelFlow with MIT License | 6 votes |
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 11
Source File: Skylight_Movie2.java From PixelFlow with MIT License | 6 votes |
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 12
Source File: Skylight_BulletPhysics_MengerSponge.java From PixelFlow with MIT License | 6 votes |
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 13
Source File: Skylight_BulletPhysics_CellFracture.java From PixelFlow with MIT License | 6 votes |
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 14
Source File: Skylight_BulletPhysics_Cubes.java From PixelFlow with MIT License | 6 votes |
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 15
Source File: Skylight_Cubes.java From PixelFlow with MIT License | 6 votes |
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 16
Source File: Skylight_PoissonSphereSamples.java From PixelFlow with MIT License | 6 votes |
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 17
Source File: Skylight_Movie3.java From PixelFlow with MIT License | 5 votes |
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 18
Source File: PickAndMove.java From PixelFlow with MIT License | 5 votes |
public void displayScene(PGraphics3D canvas){ if(canvas == pg_pick){ canvas.blendMode(REPLACE); canvas.clear(); canvas.noLights(); canvas.shape(group_pick); } else { canvas.blendMode(BLEND); canvas.background(32); canvas.lights(); canvas.shape(shp_gizmo); canvas.shape(shp_grid); canvas.shape(group_render); } }
Example 19
Source File: Skylight_ClothSimulation.java From PixelFlow with MIT License | 5 votes |
public void displayGizmo(PGraphics3D canvas, float s){ if(shp_gizmo == null){ shp_gizmo = createShape(); shp_gizmo.beginShape(LINES); shp_gizmo.strokeWeight(1); shp_gizmo.stroke(255,0,0); shp_gizmo.vertex(0,0,0); shp_gizmo.vertex(s,0,0); shp_gizmo.stroke(0,255,0); shp_gizmo.vertex(0,0,0); shp_gizmo.vertex(0,s,0); shp_gizmo.stroke(0,0,255); shp_gizmo.vertex(0,0,0); shp_gizmo.vertex(0,0,s); shp_gizmo.endShape(); } canvas.shape(shp_gizmo); }
Example 20
Source File: Skylight_ClothSimulation.java From PixelFlow with MIT License | 4 votes |
public void displayAABB(PGraphics3D canvas, float[] aabb){ if(shp_aabb == null){ float xmin = aabb[0], xmax = aabb[3]; float ymin = aabb[1], ymax = aabb[4]; float zmin = aabb[2], zmax = aabb[5]; shp_aabb = createShape(GROUP); PShape plane_zmin = createShape(); plane_zmin.beginShape(QUAD); plane_zmin.stroke(0); plane_zmin.strokeWeight(1); plane_zmin.fill(16,96,192); plane_zmin.normal(0, 0, 1); plane_zmin.vertex(xmin, ymin, zmin); plane_zmin.normal(0, 0, 1); plane_zmin.vertex(xmax, ymin, zmin); plane_zmin.normal(0, 0, 1); plane_zmin.vertex(xmax, ymax, zmin); plane_zmin.normal(0, 0, 1); plane_zmin.vertex(xmin, ymax, zmin); plane_zmin.endShape(CLOSE); shp_aabb.addChild(plane_zmin); PShape plane_zmax = createShape(); plane_zmax.beginShape(QUAD); plane_zmax.noFill(); plane_zmax.stroke(0); plane_zmax.strokeWeight(1); plane_zmax.vertex(xmin, ymin, zmax); plane_zmax.vertex(xmax, ymin, zmax); plane_zmax.vertex(xmax, ymax, zmax); plane_zmax.vertex(xmin, ymax, zmax); plane_zmax.endShape(CLOSE); shp_aabb.addChild(plane_zmax); PShape vert_lines = createShape(); vert_lines.beginShape(LINES); vert_lines.stroke(0); vert_lines.strokeWeight(1); vert_lines.vertex(xmin, ymin, zmin); vert_lines.vertex(xmin, ymin, zmax); vert_lines.vertex(xmax, ymin, zmin); vert_lines.vertex(xmax, ymin, zmax); vert_lines.vertex(xmax, ymax, zmin); vert_lines.vertex(xmax, ymax, zmax); vert_lines.vertex(xmin, ymax, zmin); vert_lines.vertex(xmin, ymax, zmax); vert_lines.endShape(); shp_aabb.addChild(vert_lines); PShape corners = createShape(); corners.beginShape(POINTS); corners.stroke(0); corners.strokeWeight(7); corners.vertex(xmin, ymin, zmin); corners.vertex(xmin, ymin, zmax); corners.vertex(xmax, ymin, zmin); corners.vertex(xmax, ymin, zmax); corners.vertex(xmax, ymax, zmin); corners.vertex(xmax, ymax, zmax); corners.vertex(xmin, ymax, zmin); corners.vertex(xmin, ymax, zmax); corners.endShape(); shp_aabb.addChild(corners); } canvas.shape(shp_aabb); }