首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >增加SCNGeometry中线条的粗细

增加SCNGeometry中线条的粗细
EN

Stack Overflow用户
提问于 2017-08-31 03:34:27
回答 1查看 1.8K关注 0票数 2

我已经创建了一条线,但是我不能增加它的粗细。

firstMaterial有什么东西可以用来增加我的线条的厚度吗?

以下是我的函数:

代码语言:javascript
复制
func getDrawnLineFrom(pos1: SCNVector3, toPos2: SCNVector3) -> SCNNode {

        let line = lineFrom(vector: pos1, toVector: toPos2)
        let lineInBetween1 = SCNNode(geometry: line)
        line.firstMaterial?.diffuse.contents  = UIColor.blue

        return lineInBetween1
    }

    func lineFrom(vector vector1: SCNVector3, toVector vector2: SCNVector3) -> SCNGeometry{

        let indices: [Int32] = [0, 1]
        let source = SCNGeometrySource(vertices: [vector1, vector2])
        let element = SCNGeometryElement(indices: indices, primitiveType: .line)


        return SCNGeometry(sources: [source], elements: [element])
    }
EN

回答 1

Stack Overflow用户

发布于 2017-08-31 07:02:52

它是哪种几何图形?SCNPlaneSCNBox具有widthheight属性,您可以使用它们来指定直线的长度和粗细。如果它是SCNShape,你可以在你用来创建它的路径上定义厚度。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45968416

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档