2

I'm trying to use scenekit on osx to render a scene from different points of view at 60Hz.

To do so, I have 2 different SCNView. The scene render is OK but :

-> the physics engine and animation are running in both SCNViews for the common scene, resulting in a 2x execution physics speed and particle system speed.

Question : How to render different point of view of the scene in different views ... without having any impact on particle system and physics speed.

My code looks like this :

class GameViewController: NSViewController,SCNSceneRendererDelegate {

    @IBOutlet weak var scnView1: SCNView!
    @IBOutlet weak var scnView2: SCNView!

    ...

    func renderer(aRenderer: SCNSceneRenderer,
        didSimulatePhysicsAtTime time: NSTimeInterval) {
        ...
    }

    ...

    override func awakeFromNib(){

        // create a the scene
        let scene = SCNScene()

        // set up the scene
        ...

        // create two cameras 
        let cameraNode1 = SCNNode()
        cameraNode.position = ...
        cameraNode.rotation = ...
        scene.rootNode.addChildNode(cameraNode1)

        let cameraNode2 = SCNNode()
        cameraNode.position = ...
        cameraNode.rotation = ...
        scene.rootNode.addChildNode(cameraNode2)

        // set up the first view
        scnView1.scene = scene

        // initial point of view
        scnView1.pointOfView = cameraNode1

        // plug game logic
        scnView1.delegate = self

        // set up the second view
        scnView2.scene = scene

        // initial point of view
        scnView2.pointOfView = cameraNode2

}

  • Setup is actually not a verb. You should capitalize the U and let others know if you see them make the same mistake. –  Jul 06 '15 at 14:41
  • 1
    setupScene -> setUpScene done ! –  Jul 06 '15 at 16:33
  • Grammar/style points aside... this is an interesting question, and possibly a bug. I'd recommend [filing it with Apple](http://bugreport.apple.com) regardless. – rickster Jul 06 '15 at 21:03
  • (Oh, and speaking of style, it's better to use `let` instead of `var` for references you're not changing.) – rickster Jul 06 '15 at 21:03
  • @rickster: var->let done ! –  Jul 08 '15 at 15:47
  • @rickster... bug (?) reported to apple ! I will the answer here. –  Jul 08 '15 at 15:49

0 Answers0