本文整理汇总了Java中processing.core.PShape.setName方法的典型用法代码示例。如果您正苦于以下问题:Java PShape.setName方法的具体用法?Java PShape.setName怎么用?Java PShape.setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类processing.core.PShape
的用法示例。
在下文中一共展示了PShape.setName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setShapeParticles
import processing.core.PShape; //导入方法依赖的package包/类
protected void setShapeParticles(PApplet pg, PShape child){
if(shp_particles == null){
shp_particles = pg.createShape(PConstants.GROUP);
shp_particles.setName("shp_particles (root)");
} else {
removeChilds(shp_particles);
}
child.setName("shp_particles");
shp_particles.addChild(child);
}
示例2: setShapeMesh
import processing.core.PShape; //导入方法依赖的package包/类
protected void setShapeMesh(PApplet pg, PShape child){
if(shp_mesh == null){
shp_mesh = pg.createShape(PConstants.GROUP);
shp_mesh.setName("shp_mesh (root)");
} else {
removeChilds(shp_mesh);
}
child.setName("shp_mesh");
shp_mesh.addChild(child);
}
示例3: setShapeWireframe
import processing.core.PShape; //导入方法依赖的package包/类
protected void setShapeWireframe(PApplet pg, PShape child){
if(shp_wireframe == null){
shp_wireframe = pg.createShape(PConstants.GROUP);
shp_wireframe.setName("shp_wireframe (root)");
} else {
removeChilds(shp_wireframe);
}
child.setName("shp_wireframe");
shp_wireframe.addChild(child);
}
示例4: createShapeMesh
import processing.core.PShape; //导入方法依赖的package包/类
@Override
public void createShapeMesh(PGraphics pg) {
PShape shp = pg.createShape();
shp.setName("gridXYp");
displayGridXY(shp, texture_XYp);
setShapeMesh(pg.parent, shp);
}
示例5: createVoronoiCellShape
import processing.core.PShape; //导入方法依赖的package包/类
public PShape createVoronoiCellShape(WB_VoronoiCell3D cell, Vector3f center_of_mass){
boolean[] on_bounds = cell.getVerticesOnBoundary();
PShape voronoi_cell = createShape(GROUP);
WB_Mesh mesh = cell.getMesh();
int[][] faces = mesh.getFacesAsInt();
int on_boundary = 0;
for(int j = 0; j < faces.length; j++){
int[] face = faces[j];
WB_Vector normal = mesh.getFaceNormal(j);
PShape polygon = createShape();
polygon.beginShape(POLYGON);
polygon.normal(normal.xf(), normal.yf(), normal.zf());
for(int k = 0; k < face.length; k++){
WB_Coord vtx = mesh.getVertex(face[k]);
float x = vtx.xf() - center_of_mass.x;
float y = vtx.yf() - center_of_mass.y;
float z = vtx.zf() - center_of_mass.z;
polygon.vertex(x,y,z);
if(on_bounds[face[k]]){
on_boundary++;
}
}
polygon.endShape(CLOSE);
// polygon.setFill(true);
// if(on_boundary == face.length){
// if(on_boundary > 0){
// polygon.setFill(color(8));
// } else {
// polygon.setFill(color(255,0,0));
// }
//
// polygon.setStroke(false);
voronoi_cell.addChild(polygon);
}
String wire = "";
voronoi_cell.setFill(true);
// if(on_boundary == face.length){
if(on_boundary > 0){
voronoi_cell.setFill(color(32));
wire = "[wire]";
} else {
voronoi_cell.setFill(color(255,8,0));
}
voronoi_cell.setStroke(false);
voronoi_cell.setStroke(color(64,4,0));
voronoi_cell.setName("[cvh] "+wire);
return voronoi_cell;
}