- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
已更新
我使用以下 Material 创建了一些 SCNTube:
let radius: CGFloat = 0.3
let height: CGFloat = 0.5
let color: UIColor = UIColor(red:0.17, green:0.62, blue:0.76, alpha:1.0)
let geometryTube = SCNTube(innerRadius: (radius - 0.1), outerRadius: radius, height: height)
let matOuter = SCNMaterial()
matOuter.diffuse.contents = color
matOuter.transparency = 0.1
let matInner = SCNMaterial()
matInner.diffuse.contents = color
matInner.transparency = 0.6
let matTop = SCNMaterial()
matTop.diffuse.contents = color
geometryTube.materials = [matOuter, matInner, matTop]
for index in 0...20 {
let node = SCNNode(geometry: geometryTube)
node.position = SCNVector3(1.0 + Double(index), -1.0, 0.0);
sceneView.scene.rootNode.addChildNode(node)
}
灯管闪烁的角度取决于角度。
最佳答案
materials
属性设计为每个geometry
都有一个material
- 而您要为一个几何体分配三种 Material .这些都是重叠的,scenekit
必须决定在每个点渲染什么。
编辑:我的回答(以上)是错误的 - 我不会删除它,而是添加 this强调我错的原因:
If a geometry has the same number of materials as it has geometry elements, the material index corresponds to the element index. For geometries with fewer materials than elements, SceneKit determines the material index for each element by calculating the index of that element modulo the number of materials. For example, in a geometry with six elements and three materials, SceneKit renders the element at index 5 using the material at index 5 % 3 = 2.
很抱歉对您的问题没有帮助。
关于swift - 具有透明度的闪烁 SCNTube,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49324471/
已更新 我使用以下 Material 创建了一些 SCNTube: let radius: CGFloat = 0.3 let height: CGFloat = 0.5 let color: UIC
我正在尝试在 SceneKit 中制作一个 pipe 及其物理体。 let BoxGeometry = SCNTube(innerRadius: 5, outerRadius: 12.5, heigh
我是一名优秀的程序员,十分优秀!