因此,我使用SceneKit来呈现一个参数曲面集合(其和构成一个对象)。为了把这些放在屏幕上,我正在通过采样点和创建三角形来创建定制的几何图形。下面是我如何做这件事的快速浏览。
Loop through the collection of surfaces
Generate a random color C
For each surface calculate a grid of N x N points (both positions and normals)
Assign all vertexes for that surface the color C
A
我有一个3d隧道和一个跑步者。我在搅拌机中制作了这个隧道,每当我点击它开始运行并穿过隧道墙的人时,就把它导入到scenekit.Now中。我希望隧道墙是静态的,这样移动的人就不应该穿过墙壁,只在隧道内移动。我在隧道节点上应用物理,但它不工作,它给出的消息是“警告,物理形状生成中尚不支持非三角形列表元素类型”。
scene = SCNScene(named: "game.scnassets/UpdatedTunnel/second.dae")!
let Tunnel = scene.rootNode.childNodeWithName("SketchUp"
我很难理解如何将.dae文件中的几何图形加载到iOS SceneKit场景图中。
我知道您可以直接将.dae文件加载到SCNScene中:
// create a new scene
let scene = SCNScene("test.scnassets/test.dae")
我还知道,您可以创建一个空的SCNScene,并将内置的3D对象作为子节点添加到其中:
let scene = SCNScene()
var sphereNode = SCNNode()
sphereNode.geometry = SCNSphere(radius: 1.0)
scene.rootNod
我正在尝试使用轻击手势来突出显示SceneKit中选定的节点。不幸的是,我没能做到这一点。我能做的最好的事情就是在点击节点时改变材料。
let material = key.geometry!.firstMaterial!
material.emission.contents = UIColor.blackColor()
有没有人能给我一个建议,让我在对象周围添加边框或轮廓,而不是改变整个节点的颜色?