当前位置: 首页>>代码示例>>Java>>正文


Java PShape.setStrokeWeight方法代码示例

本文整理汇总了Java中processing.core.PShape.setStrokeWeight方法的典型用法代码示例。如果您正苦于以下问题:Java PShape.setStrokeWeight方法的具体用法?Java PShape.setStrokeWeight怎么用?Java PShape.setStrokeWeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在processing.core.PShape的用法示例。


在下文中一共展示了PShape.setStrokeWeight方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createShape

import processing.core.PShape; //导入方法依赖的package包/类
private PShape createShape(PApplet papplet, float radius, boolean icosahedron){
    PShape shape;
    
    if(!icosahedron){
      shape = papplet.createShape(PConstants.POINT, 0, 0);
      shape.setStroke(true);
      shape.setStrokeWeight(1);
    } else {
      if(ifs == null){
        ifs = new DwIcosahedron(1);
//        ifs = new DwCube(1);
      }
      shape = papplet.createShape(PShape.GEOMETRY);
      shape.setStroke(false);
      shape.setFill(true);
      DwMeshUtils.createPolyhedronShape(shape, ifs, radius, 3, true);
    }

    return shape;
  }
 
开发者ID:diwi,项目名称:PixelFlow,代码行数:21,代码来源:DwSoftBody3D.java

示例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;
}
 
开发者ID:diwi,项目名称:LiquidFunProcessing,代码行数:16,代码来源:DwWorld.java

示例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);
  }
 
开发者ID:diwi,项目名称:PixelFlow,代码行数:33,代码来源:Sampling_Poisson3D.java

示例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);
}
 
开发者ID:diwi,项目名称:PixelFlow,代码行数:8,代码来源:Sampling_Fibonacci.java

示例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);
}
 
开发者ID:diwi,项目名称:PixelFlow,代码行数:8,代码来源:Sampling_Halton.java

示例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);
  }
 
开发者ID:diwi,项目名称:PixelFlow,代码行数:33,代码来源:Skylight_PoissonSphereSamples.java

示例7: 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;
}
 
开发者ID:diwi,项目名称:PixelFlow,代码行数:10,代码来源:Skylight_BulletPhysics_Breakable.java

示例8: 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);
}
 
开发者ID:diwi,项目名称:PixelFlow,代码行数:12,代码来源:DwSoftBall3D.java

示例9: 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);
}
 
开发者ID:diwi,项目名称:PixelFlow,代码行数:12,代码来源:DwSoftBall2D.java

示例10: 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);
}
 
开发者ID:diwi,项目名称:PixelFlow,代码行数:13,代码来源:DwSoftGrid2D.java

示例11: 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);
}
 
开发者ID:diwi,项目名称:PixelFlow,代码行数:13,代码来源:DwSoftGrid3D.java


注:本文中的processing.core.PShape.setStrokeWeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。