如何设置 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/25268386/