gpt4 book ai didi

colors - 更改 SCNText 节点对象的颜色或纹理(Swift - Scenekit)

转载 作者:行者123 更新时间:2023-11-30 11:56:52 28 4
gpt4 key购买 nike

如何设置 SCNText 对象的纹理?这就是我所拥有的,外观没有任何变化:

// myNode is a working SCNText element 

let mat = SCNMaterial()
met.diffuse.contents = UIImage(contentsOfFile: "texture.png")
myNode.geometry.firstMaterial = mat

最佳答案

A text geometry may contain one, three, or five geometry elements:

If its extrusionDepth property is 0.0, the text geometry has one element corresponding to its one visible side.If its extrusion depth is greater than zero and its chamferRadius property is 0.0, the text geometry has three elements, corresponding to its front, back, and extruded sides.If both extrusion depth and chamfer radius are greater than zero, the text geometry has five elements, corresponding to its front, back, extruded sides, front chamfer, and back chamfer.Scene Kit can render each element using a different material. For details, see the description of the materials property in SCNGeometry Class Reference.

就像任何其他几何体一样,只需设置其materials属性即可。

关于colors - 更改 SCNText 节点对象的颜色或纹理(Swift - Scenekit),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47719953/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com