本文整理汇总了Java中processing.core.PShape.setStroke方法的典型用法代码示例。如果您正苦于以下问题:Java PShape.setStroke方法的具体用法?Java PShape.setStroke怎么用?Java PShape.setStroke使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类processing.core.PShape
的用法示例。
在下文中一共展示了PShape.setStroke方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createParticleShape
import processing.core.PShape; //导入方法依赖的package包/类
public PShape createParticleShape(DwParticle3D particle){
PShape shp_particle = papplet.createShape(PShape.GEOMETRY);
shp_particle.resetMatrix();
shp_particle.translate(particle.cx, particle.cy, particle.cz);
shp_particle.rotateX(papplet.random(PConstants.TWO_PI));
shp_particle.rotateY(papplet.random(PConstants.TWO_PI));
shp_particle.rotateZ(papplet.random(PConstants.TWO_PI));
shp_particle.setStroke(false);
// shp_particle.setFill(papplet.color(160));
if(ifs == null) ifs = new DwIcosahedron(1);
// if(ifs == null) ifs = new DwCube(1);
DwMeshUtils.createPolyhedronShape(shp_particle, ifs, 1, 3, true);
return shp_particle;
}
示例2: setStyle
import processing.core.PShape; //导入方法依赖的package包/类
public PShape setStyle(PShape shp
, boolean fill_enabled
, int fill_color
, boolean stroke_enabled
, int stroke_color
, float stroke_weight
){
if(shp == null) return null;
shp.setFill (fill_enabled);
shp.setFill (fill_color);
shp.setStroke (stroke_enabled);
shp.setStroke (stroke_color);
shp.setStrokeWeight(stroke_weight / transform.screen_scale);
return shp;
}
示例3: addShape
import processing.core.PShape; //导入方法依赖的package包/类
void addShape(MyPoissonSample sample){
PShape shp_point = createShape(POINT, sample.x(), sample.y(), sample.z());
shp_point.setStroke(color(255));
shp_point.setStrokeWeight(3);
shp_samples_points.addChild(shp_point);
if(ifs == null){
ifs = new DwIcosahedron(2); verts_per_face = 3;
// ifs = new DwCube(2); verts_per_face = 4;
}
PShape shp_sphere = createShape(PShape.GEOMETRY);
shp_sphere.setStroke(false);
shp_sphere.setFill(color(255));
shp_sphere.resetMatrix();
shp_sphere.translate(sample.x(), sample.y(), sample.z());
DwMeshUtils.createPolyhedronShape(shp_sphere, ifs, sample.rad(), verts_per_face, true);
shp_samples_spheres.addChild(shp_sphere);
// PShape shp_sphere_normals = createShape(PShape.GEOMETRY);
// shp_sphere_normals.setStroke(false);
// shp_sphere_normals.setFill(color(255));
// shp_sphere_normals.resetMatrix();
// shp_sphere_normals.translate(sample.x(), sample.y(), sample.z());
//
// DwMeshUtils.createPolyhedronShapeNormals(shp_sphere_normals, ifs, sample.rad(), 10);
//
// shp_samples_spheres.addChild(shp_sphere_normals);
}
示例4: addShape
import processing.core.PShape; //导入方法依赖的package包/类
void addShape(float[] position, float scale){
PVector pos = new PVector().set(position).mult(scale);
PShape shp_point = createShape(POINT, pos.x, pos.y);
shp_point.setStroke(color(255));
shp_point.setStrokeWeight(3);
shp_samples.addChild(shp_point);
}
示例5: addShape
import processing.core.PShape; //导入方法依赖的package包/类
void addShape(float[] position, float scale){
PVector pos = new PVector().set(position).mult(scale);
PShape shp_point = createShape(POINT, pos.x, pos.y, pos.z);
shp_point.setStroke(color(255));
shp_point.setStrokeWeight(3);
shp_samples.addChild(shp_point);
}
示例6: addShape
import processing.core.PShape; //导入方法依赖的package包/类
void addShape(MyPoissonSample sample){
PShape shp_point = createShape(POINT, sample.x(), sample.y(), sample.z());
shp_point.setStroke(color(255));
shp_point.setStrokeWeight(3);
shp_samples_points.addChild(shp_point);
if(ifs == null){
ifs = new DwIcosahedron(2); verts_per_face = 3;
// ifs = new DwCube(3); verts_per_face = 4;
}
PShape shp_sphere = createShape(PShape.GEOMETRY);
shp_sphere.setStroke(false);
shp_sphere.setFill(color(255));
colorMode(HSB, 360, 1, 1);
float hsb_h = 15 + (float)(Math.random() - 0.5f) * 45 ;
float hsb_s = (float) Math.random() * 0.99f + 0.01f;
float hsb_b = hsb_s*3;
shp_sphere.setFill(color(hsb_h, hsb_s, hsb_b));
colorMode(RGB);
shp_sphere.resetMatrix();
shp_sphere.translate(sample.x(), sample.y(), sample.z());
boolean flat_shading = random(1) > 0.5f;
DwMeshUtils.createPolyhedronShape(shp_sphere, ifs, sample.rad(), verts_per_face, flat_shading);
shp_samples_spheres.addChild(shp_sphere);
}
示例7: createShapeWireframe
import processing.core.PShape; //导入方法依赖的package包/类
@Override
public void createShapeWireframe(PGraphics pg, DwStrokeStyle style){
PShape shp = pg.createShape();
displayGridXY(shp, texture_XYp);
shp.setTexture(null);
shp.setFill(false);
shp.setStroke(true);
shp.setStroke(style.stroke_color);
shp.setStrokeWeight(style.stroke_weight);
setShapeWireframe(pg.parent, shp);
}
示例8: toggleDisplayWireFrame
import processing.core.PShape; //导入方法依赖的package包/类
public void toggleDisplayWireFrame(){
DISPLAY_WIREFRAME = !DISPLAY_WIREFRAME;
for (BObject body : physics.rigidBodies) {
PShape shp = body.displayShape;
String name = shp.getName();
if(name != null && name.contains("[wire]")){
shp.setFill(!DISPLAY_WIREFRAME);
shp.setStroke(DISPLAY_WIREFRAME);
}
}
skylight.reset();
}
示例9: toggleDisplayWireFrame
import processing.core.PShape; //导入方法依赖的package包/类
public void toggleDisplayWireFrame(int mode){
DISPLAY_WIREFRAME = mode;
for (BObject body : physics.rigidBodies) {
PShape shp = body.displayShape;
String name = shp.getName();
if(name != null){
if(mode == 1){
if(name.contains("[wire1]")){
shp.setFill(false);
shp.setStroke(true);
} else {
shp.setFill(true);
shp.setStroke(false);
}
} else if(mode == 2){
if(name.contains("[wire2]")){
shp.setFill(false);
shp.setStroke(true);
} else {
shp.setFill(true);
shp.setStroke(false);
}
} else {
shp.setFill(true);
shp.setStroke(false);
}
}
}
skylight.reset();
}
示例10: createScene
import processing.core.PShape; //导入方法依赖的package包/类
public void createScene(){
int scale = 5;
int src_w = pg_src.width;
int src_h = pg_src.height;
int num_x = src_w/scale;
int num_y = src_h/scale;
pg_src_small = (PGraphics2D) createGraphics(num_x, num_y, P2D);
pg_src_small_tmp = (PGraphics2D) createGraphics(num_x, num_y, P2D);
pg_src_small.loadPixels();
opticalflow.resize(src_w, src_h);
pg_src_tmp = (PGraphics2D) createGraphics(src_w, src_h, P2D);
tex_vel_small.resize(context, opticalflow.frameCurr.velocity);
tex_vel_small.resize(context, num_x, num_y);
pg_oflow = (PGraphics2D) createGraphics(src_w, src_h, P2D);
group_cubes = createShape(GROUP);
shp_cubes = new PShape[num_x * num_y];
for(int y = 0; y < num_y; y++){
for(int x = 0; x < num_x; x++){
int idx = y * num_x + x;
PShape shp_cube = createShape(BOX, 1, 1, 1);
shp_cube.setStroke(false);
shp_cube.setStroke(color(0));
shp_cube.setFill(true);
shp_cubes[idx] = shp_cube;
group_cubes.addChild(shp_cube);
}
}
}
示例11: createBoxShape
import processing.core.PShape; //导入方法依赖的package包/类
public PShape createBoxShape(Vector3f dim){
PShape shp = createShape(BOX, dim.x, dim.y, dim.z);
shp.setStroke(false);
shp.setFill(true);
shp.setFill(color(16));
shp.setStrokeWeight(1);
shp.setStroke(color(0));
return shp;
}
示例12: createShapeWireframe
import processing.core.PShape; //导入方法依赖的package包/类
@Override
public void createShapeWireframe(PGraphics pg, DwStrokeStyle style){
PShape shp = createShape(pg);
shp.setTexture(null);
shp.setFill(false);
shp.setStroke(true);
shp.setStroke(style.stroke_color);
shp.setStrokeWeight(style.stroke_weight);
setShapeWireframe(pg.parent, shp);
}
示例13: createShapeMesh
import processing.core.PShape; //导入方法依赖的package包/类
@Override
public void createShapeMesh(PGraphics pg){
PShape shp = createShape(pg);
shp.setStroke(false);
setShapeMesh(pg.parent, shp);
}
示例14: createShape
import processing.core.PShape; //导入方法依赖的package包/类
private PShape createShape(PApplet papplet, float radius){
PShape shape = papplet.createShape(PConstants.ELLIPSE, 0, 0, radius*2, radius*2);
shape.setStroke(false);
shape.setFill(true);
return shape;
}
示例15: createShapeMesh
import processing.core.PShape; //导入方法依赖的package包/类
@Override
public void createShapeMesh(PGraphics pg) {
PShape shp = createShape(pg);
shp.setStroke(false);
setShapeMesh(pg.parent, shp);
}