【问题标题】:Drawing an arc with SCNShape and UIBezierPath使用 SCNShape 和 UIBezierPath 绘制圆弧
【发布时间】:2018-04-02 06:13:17
【问题描述】:

我正在尝试使用以下代码在SCNShape 中画一个馅饼:

UIBezierPath *piePiece = [UIBezierPath bezierPath];
[piePiece addArcWithCenter: CGPointZero radius:  0.150 startAngle: 0.0 endAngle: M_PI/6  clockwise: YES];
[piePiece closePath];
SCNShape *pieShape = [SCNShape shapeWithPath: piePiece extrusionDepth: 0];
pieShape.firstMaterial.diffuse.contents = [UIColor blueColor];
pieShape.firstMaterial.doubleSided = YES;
SCNNode *pieNode = [SCNNode nodeWithGeometry: pieShape];

但我得到以下形状:

Sample 我没有看到弧线。我做错了什么?

谢谢

【问题讨论】:

    标签: ios objective-c scenekit


    【解决方案1】:

    您必须将 UIBezierPath 的平坦度更改为较低的值。在斯威夫特:

    pieShape.flatness = 0.0003
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-03-14
      • 1970-01-01
      • 1970-01-01
      • 2018-07-15
      • 2017-09-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多