本文整理汇总了Java中processing.core.PShape.noFill方法的典型用法代码示例。如果您正苦于以下问题:Java PShape.noFill方法的具体用法?Java PShape.noFill怎么用?Java PShape.noFill使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类processing.core.PShape
的用法示例。
在下文中一共展示了PShape.noFill方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateShapesCount
import processing.core.PShape; //导入方法依赖的package包/类
protected void updateShapesCount(){
if(particle_num == 0){
return;
}
// synchronize buffer size
int shp_count = shp_particles.getChildCount();
if(shp_count != particle_num){
// remove shapes, in case group is bigger than actual number
for(int i = shp_count - 1; i >= particle_num; i--){
shp_particles.removeChild(i);
}
// add shapes, in case group is smaller then actual number
for(int i = shp_count; i < particle_num; i++){
PShape shp_particle = papplet.createShape();
shp_particle.beginShape(PConstants.QUADS);
shp_particle.noFill();
shp_particle.noStroke();
shp_particle.textureMode(PConstants.NORMAL); // TODO: report issue
shp_particle.texture(param.tex_sprite); // TODO: report issue
shp_particle.vertex(-1, -1, 0, 0);
shp_particle.vertex(+1, -1, 1, 0);
shp_particle.vertex(+1, +1, 1, 1);
shp_particle.vertex(-1, +1, 0, 1);
shp_particle.endShape();
shp_particles.addChild(shp_particle);
}
}
}
示例2: createParticleShape
import processing.core.PShape; //导入方法依赖的package包/类
public PShape createParticleShape(DwParticle2D particle, PImage pimg_sprite){
final float rad = 2;
PShape shp_sprite = papplet.createShape();
shp_sprite.beginShape(PConstants.QUADS);
shp_sprite.noStroke();
shp_sprite.noFill();
shp_sprite.tint(255,10,10);
if(particle.idx == IDX_MOUSE_PARTICLE){
shp_sprite.tint(200,100,100);
} else {
float r = 0 + papplet.random(-30, 30);
float g = 100;
float b = 100;
shp_sprite.tint(r,g,b);
}
shp_sprite.textureMode(PConstants.NORMAL);
shp_sprite.texture(pimg_sprite);
shp_sprite.normal(0, 0, 1);
shp_sprite.vertex(-rad, -rad, 0, 0);
shp_sprite.vertex(+rad, -rad, 1, 0);
shp_sprite.vertex(+rad, +rad, 1, 1);
shp_sprite.vertex(-rad, +rad, 0, 1);
shp_sprite.endShape();
return shp_sprite;
}
示例3: createParticleShape
import processing.core.PShape; //导入方法依赖的package包/类
public PShape createParticleShape(DwParticle2D particle, PImage sprite_img){
final float rad = particle.rad;
PShape shp_particle = papplet.createShape(PShape.GROUP);
if( PARTICLE_SHAPE_IDX >= 0 && PARTICLE_SHAPE_IDX < 4){
PShape sprite = papplet.createShape(PShape.GEOMETRY);
sprite.beginShape(PConstants.QUAD);
sprite.noStroke();
sprite.noFill();
sprite.textureMode(PConstants.NORMAL);
sprite.texture(sprite_img);
sprite.normal(0, 0, 1);
sprite.vertex(-rad, -rad, 0, 0);
sprite.vertex(+rad, -rad, 1, 0);
sprite.vertex(+rad, +rad, 1, 1);
sprite.vertex(-rad, +rad, 0, 1);
sprite.endShape();
shp_particle.addChild(sprite);
}
else if( PARTICLE_SHAPE_IDX == 4){
float threshold1 = 1; // radius shortening for arc segments
float threshold2 = 140; // arc between segments
double arc1 = Math.acos(Math.max((rad-threshold1), 0) / rad);
double arc2 = (180 - threshold2) * Math.PI / 180;
double arc = Math.min(arc1, arc2);
int num_vtx = (int)Math.ceil(2*Math.PI/arc);
// System.out.println(num_vtx);
PShape circle = papplet.createShape(PShape.GEOMETRY);
circle.beginShape();
circle.noStroke();
circle.fill(200,100);
for(int i = 0; i < num_vtx; i++){
float vx = (float) Math.cos(i * 2*Math.PI/num_vtx) * rad;
float vy = (float) Math.sin(i * 2*Math.PI/num_vtx) * rad;
circle.vertex(vx, vy);
}
circle.endShape(PConstants.CLOSE);
PShape line = papplet.createShape(PShape.GEOMETRY);
line.beginShape(PConstants.LINES);
line.stroke(0, 100);
line.strokeWeight(1);
line.vertex(0, 0);
line.vertex(-(rad-1), 0);
line.endShape();
// PShape circle = papplet.createShape(PConstants.ELLIPSE, 0, 0, rad*2, rad*2);
// circle.setStroke(false);
// circle.setFill(papplet.color(200,100));
//
// PShape line = papplet.createShape(PConstants.LINE, 0, 0, -(rad-1), 0);
// line.setStroke(papplet.color(0,200));
// line.setStrokeWeight(1);
shp_particle.addChild(circle);
shp_particle.addChild(line);
}
return shp_particle;
}
示例4: displayAABB
import processing.core.PShape; //导入方法依赖的package包/类
public void displayAABB(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(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);
}
shape(shp_aabb);
}
示例5: displayAABB
import processing.core.PShape; //导入方法依赖的package包/类
public void displayAABB(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(64);
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);
}
shape(shp_aabb);
}
示例6: displayAABB
import processing.core.PShape; //导入方法依赖的package包/类
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);
}