Ios ARKit-如何使三维模型具有光泽?
我正在使用ARKit,我希望我的模型通过使用以下代码看起来更真实:Ios ARKit-如何使三维模型具有光泽?,ios,arkit,Ios,Arkit,我正在使用ARKit,我希望我的模型通过使用以下代码看起来更真实: self.sceneView.autoenablesDefaultLighting = true self.sceneView.automaticallyUpdatesLighting = true 但这段代码并没有使我的模型像金属材质一样(有光泽)。如何使材料看起来像金属?谢谢。杜潘-我想你真的在问如何使一个物体发光或有光泽。我会用sceneKit来解释 首先看一看这个漂亮的图形,它解释了sceneKit基于节点的框架:
self.sceneView.autoenablesDefaultLighting = true
self.sceneView.automaticallyUpdatesLighting = true
但这段代码并没有使我的模型像金属材质一样(有光泽)。如何使材料看起来像金属?谢谢。杜潘-我想你真的在问如何使一个物体发光或有光泽。我会用sceneKit来解释 首先看一看这个漂亮的图形,它解释了sceneKit基于节点的框架: 现在看看这段代码,看看它是否对您有所帮助
// create a node object
let ballNode = SCNNode()
// create a geometery object
// notice the after firstMaterial is [diffuse][2] and [specular][3]
// this sets the shading attributes that define the appearance of a
// geometry's surface when rendered
let ballGeometery = SCNSphere(radius: 0.5)
ballGeometry.firstMaterial!.diffuse.contents = UIColor.blue
ballGeometry.firstMaterial!.specular.contents = UIColor.white
// attached the geometry to the node
ballNode.geometry = ballGeometry
// add ballNode to sceneViews scene's rootNode
sceneView.scene.rootNode.addChildNode(ballNode)
请注意,有许多方法可以在渲染时设置几何体的曲面-
我希望这有帮助
享受它 Duc Phan-我想你真的在问如何使一个物体发光或有光泽。我会用sceneKit来解释 首先看一看这个漂亮的图形,它解释了sceneKit基于节点的框架: 现在看看这段代码,看看它是否对您有所帮助
// create a node object
let ballNode = SCNNode()
// create a geometery object
// notice the after firstMaterial is [diffuse][2] and [specular][3]
// this sets the shading attributes that define the appearance of a
// geometry's surface when rendered
let ballGeometery = SCNSphere(radius: 0.5)
ballGeometry.firstMaterial!.diffuse.contents = UIColor.blue
ballGeometry.firstMaterial!.specular.contents = UIColor.white
// attached the geometry to the node
ballNode.geometry = ballGeometry
// add ballNode to sceneViews scene's rootNode
sceneView.scene.rootNode.addChildNode(ballNode)
请注意,有许多方法可以在渲染时设置几何体的曲面-
我希望这有帮助
享受它