我把一个物体放在一架飞机上,但它显示在大约10-15点。上面说的飞机。 我应该使用什么代码将放在平面上?
这是代码
let scene = SCNScene(named: "art.scnassets/cup.scn")!
// Set the scene to the view
sceneView.scene = scene
答案 0 :(得分:0)
您的问题尚不清楚,但请查看此代码,它可能会对您有所帮助
// helicopter is object of SCNNode
let dragonScene = SCNScene(named: "media.scnassets/helicopter.dae")!
for childNode in dragonScene.rootNode.childNodes {
// Adding all the child nodes
helicopter.addChildNode(childNode)
}
helicopter.scale = SCNVector3(x: 0.002, y: 0.002, z: 0.002)
helicopter.position = SCNVector3(x:2.0 , y:0.0, z:-1.6)
sceneView.scene.rootNode.addChildNode(helicopter)