Norway


I’m developing an which is about the solar system.
I’m trying to turnoff the , where the light hits the surface of the planet. But the problem is that an texture by default, always shows the points regardless the absence or presence of the light.

My request in a nutshell: ( I wanna hide the emission points, on places where the light hits the surface ) enter image description here ios - Swift SceneKit lighting and effecting emission texture - 9AxaD - ios – Swift SceneKit lighting and effecting emission texture

override func viewDidLoad() {
    super.viewDidLoad()

    let scene = SCNScene()

    let earth = SCNSphere(radius: 1)
    let earthNode = SCNNode()
    let earthMaterial = SCNMaterial()
    earthMaterial.diffuse.contents = UIImage(named: "earth.jpg")
    earthMaterial.emission.contents = UIImage(named: "earthEmission.jpg")
    earth.materials = [earthMaterial]
    earthNode.geometry = earth
    scene.rootNode.addChildNode(earthNode)

    let lightNode = SCNNode()
    lightNode.light = SCNLight()
    lightNode.light?.type = .omni
    lightNode.position = SCNVector3(x: 0, y: , z: 5)
    scene.rootNode.addChildNode(lightNode)

    sceneView.scene = scene


}



Source link

LEAVE A REPLY

Please enter your comment!
Please enter your name here