scenekit

Does ARKit 2.0 consider Lens Distortion in iPhone and iPad?

混江龙づ霸主 提交于 2019-12-18 12:33:14
问题 ARKit 2.0 updates many intrinsic (and extrinsic) parameters of the ARCamera from frame to frame. I'd like to know if it also takes Radial Lens Distortion into consideration (like in AVCameraCalibrationData class that ARKit doesn't use), and fix the video frames' distortion appropriately ( distort / undistort operations) for back iPhone and iPad cameras? var intrinsics: simd_float3x3 { get } As we all know, the Radial Lens Distortion greatly affects the 6 DOF pose estimation accuracy when we

Metal Shader with SceneKit SCNProgram

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-18 12:00:52
问题 I'm looking for just a working Metal shader that works in SceneKit with SCNProgram. Can someone show me the correct method declarations/how to hook this up? let program = SCNProgram() program.vertexFunctionName = "myVertex" program.fragmentFunctionName = "myFragment" material.program = program and then the shader //MyShader.metal vertex something myVertex(something) { return something; } fragment float4 myFragment(something) { return something } I'm just looking for the most basic example

Metal Shader with SceneKit SCNProgram

强颜欢笑 提交于 2019-12-18 12:00:49
问题 I'm looking for just a working Metal shader that works in SceneKit with SCNProgram. Can someone show me the correct method declarations/how to hook this up? let program = SCNProgram() program.vertexFunctionName = "myVertex" program.fragmentFunctionName = "myFragment" material.program = program and then the shader //MyShader.metal vertex something myVertex(something) { return something; } fragment float4 myFragment(something) { return something } I'm just looking for the most basic example

ARKit –Drop a shadow of 3D object on the plane surface

霸气de小男生 提交于 2019-12-18 09:30:12
问题 This is the function that I use to display object on the plane surface. private func loadScene(path: String) -> SCNNode { let spotLight = SCNLight() spotLight.type = SCNLight.LightType.probe spotLight.spotInnerAngle = 30.0 spotLight.spotOuterAngle = 80.0 spotLight.castsShadow = true let result = SCNNode() result.light = spotLight result.position = SCNVector3(-10.0, 20.0, 10.5) result.addChildNode(result) let scene = SCNScene(named: path)! for node in scene.rootNode.childNodes { result

SceneKit: how to recreate lighting from Google Poly for same OBJ file?

元气小坏坏 提交于 2019-12-18 06:56:17
问题 The goal is to recreate the lighting for this OBJ file: https://poly.google.com/view/cKryD9VnDEZ Code to load OBJ file into SceneKit (can download file from above link): let modelPath = "model.obj" let url = NSURL(string: modelPath) let scene = SCNScene(named: modelPath)! sceneView.autoenablesDefaultLighting = true sceneView.allowsCameraControl = true sceneView.scene = scene sceneView.backgroundColor = UIColor.white Options tried so far: 1) The default ambient lighting is much harsher than

Is there a way to make a dark/low light SceneKit scene?

若如初见. 提交于 2019-12-18 06:49:10
问题 I've searched and there doesn't appear to be a way to make a dark SceneKit scene... As in a scene with low lighting. I've removed all lights from my scene, set my autoenablesDefaultLighting to false, made sure it's unchecked in the storyboard, I even tried adding a black ambient light but that didn't do anything. Is there a way to make a SceneKit Scene with low/dark lighting?? 回答1: Had to try this for myself, as it didn't sound right. Removing all lights from the default SceneKit game

Is there a way to make a dark/low light SceneKit scene?

守給你的承諾、 提交于 2019-12-18 06:49:08
问题 I've searched and there doesn't appear to be a way to make a dark SceneKit scene... As in a scene with low lighting. I've removed all lights from my scene, set my autoenablesDefaultLighting to false, made sure it's unchecked in the storyboard, I even tried adding a black ambient light but that didn't do anything. Is there a way to make a SceneKit Scene with low/dark lighting?? 回答1: Had to try this for myself, as it didn't sound right. Removing all lights from the default SceneKit game

SceneKit Culling Plane

耗尽温柔 提交于 2019-12-18 05:01:52
问题 I have a SCNScene rendering in a SCNView. I have some *.dae models that are rendered/moving in the scene. I have a transparent cube, when one of my models goes behind it, I would like the model to not be rendered, because at the moment, as the cube is transparent, you can see it through the cube. Is there any property/setting/shader I can apply to the transparent cube so that anything behind it is not rendered? Example: My eye is the green dot, the cube is the blue square, my model is the red

SpriteKit and SceneKit – How to completely pause a game?

我的梦境 提交于 2019-12-18 04:21:49
问题 I succeeded to pause a scene game with this code: override func touchesBegan(touches: NSSet!, withEvent event: UIEvent!) { var touch:UITouch = touches.anyObject() as UITouch pauseText.text = "Continuer" pauseText.fontSize = 50 pauseText.position = CGPointMake(self.frame.size.width/2, self.frame.size.height/2) /* bouton play/pause */ var locationPause: CGPoint = touch.locationInNode(self) if self.nodeAtPoint(locationPause) == self.pause { println("pause") addChild(pauseText) pause

SpriteKit and SceneKit – How to completely pause a game?

 ̄綄美尐妖づ 提交于 2019-12-18 04:21:46
问题 I succeeded to pause a scene game with this code: override func touchesBegan(touches: NSSet!, withEvent event: UIEvent!) { var touch:UITouch = touches.anyObject() as UITouch pauseText.text = "Continuer" pauseText.fontSize = 50 pauseText.position = CGPointMake(self.frame.size.width/2, self.frame.size.height/2) /* bouton play/pause */ var locationPause: CGPoint = touch.locationInNode(self) if self.nodeAtPoint(locationPause) == self.pause { println("pause") addChild(pauseText) pause