scenekit

ARKit Perspective Rendering

给你一囗甜甜゛ 提交于 2019-12-23 03:17:31
问题 I am working on a perspective problem with ARKit that I encountered in one of my projects. I explain you: in the photo below, I display a 3D model along the lane, there are small 3D boxes every 2 meters. Then, I place indicators at the level of these boxes, as you can see on the photo, the 3D models shift and do not seem to be in the right place when we move away from the boxes. I would like to know if this comes from ARKit or simply from my way of displaying this model. Knowing that the 3D

How to draw a line between two points in SceneKit?

旧巷老猫 提交于 2019-12-23 03:11:27
问题 If I have two points in SceneKit (e.g. (1,2,3) and (-1,-1,-1) ). How do I draw a line between the two? I see that there is a SCNBox object I may be able to use, but that only allows me to specify the center (e.g. via simdPosition ). The other ways to modify it are the transform (which I don't know how to use), or the Euler angles (which I'm not sure how to calculate which ones I need to use). 回答1: Just build a custom geometry using SCNGeometryPrimitiveType.line : let vertices: [SCNVector3] =

SceneKit: cannot add SCNReferenceNode programmatically though works in Xcode Scene Editor

别来无恙 提交于 2019-12-23 03:02:23
问题 Adding a SCNReferenceNode works when done from the Xcode Scene Editor. When done programmatically with the code below, however, nothing appears in the scene. filePath contains a valid path as proven by the print statement as well as stepping through the code. Help? if let filePath = NSBundle.mainBundle().pathForResource("RefTest", ofType: "scn", inDirectory: "TestScene.scnassets") { let referenceURL = NSURL(fileURLWithPath: filePath) if #available(iOS 9.0, *) { let referenceNode =

Chase camera in SceneKit

烂漫一生 提交于 2019-12-23 01:04:23
问题 Say I have a node which is a cube and I am moving it within the scene, how can I have a camera that follows the box? I understand there is SCNLookAtConstraint , but what I am after is a chase camera. One that actually changes it's position so that it is sort of attached behind the node. I have not found any example code which shows a way of implementing this, does anyone have any ideas? 回答1: Can you not make your camera node a child node of the box node? 回答2: Plenty of good ideas here already

Why would Xcode show MUCH more memory use than Instruments for SceneKit app?

為{幸葍}努か 提交于 2019-12-22 19:23:11
问题 I'm trying to debug why our SceneKit-based app is using so much memory but Xcode and Instruments / Allocations seem to have very different values for the amount of memory being used. When I look in Xcode I see something like 600 MB but when I transfer the same running session over to Instruments / Allocations, I see a very different number for persistent bytes, like 150 MB . Which one is correct? Why the difference? Are they measuring different things? (Regardless of whether I Transfer an

ARKit billboarding effect with SceneKit

可紊 提交于 2019-12-22 18:43:21
问题 I am looking to add a billboarding effect that is similar to this application: https://twitter.com/marpi_/status/897130955105644544 I would like SCNodes that use SCNText geometry to always face the camera. I have attempted with out success: SCNLookAtConstraint with sceneView.pointOfView as the target, but this rotates the node to face away from the camera, resulting in backwards text, and unable to change the nodes position or euler angle. Out of the box, an SKLabelNode will always face the

SceneKit modification in 3D object and exporting file

夙愿已清 提交于 2019-12-22 18:13:27
问题 In my Application, I am displaying 3D object in SCNView using SceneKit Framework and export the modified file with some small changes like color, Temperature etc. But I am getting the original file after exporting it to the document folder. Here I can display and do some modification in 3D objects, That looks good and I can see the changes in SCNView in Simulator. sceneView = [[SCNView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height - 100)];

Add spheres at these points of the special SCNBox?

一世执手 提交于 2019-12-22 16:41:49
问题 Does someone can help me? I saw that the WWDC 2013 slide has this esample and I try it, using SCNGeometrySource . this is my code below var box = SCNBox(width: 10, height: 10, length: 10, chamferRadius: 0) box.widthSegmentCount = 3 box.heightSegmentCount = 3 box.lengthSegmentCount = 3 let positionSource = box.getGeometrySources(for: .vertex)[0] positionSource.vectorCount positionSource.data.withUnsafeBytes{(vertexBuffer: UnsafePointer<Float>) in print("a") let a = positionSource

Add spheres at these points of the special SCNBox?

。_饼干妹妹 提交于 2019-12-22 16:41:15
问题 Does someone can help me? I saw that the WWDC 2013 slide has this esample and I try it, using SCNGeometrySource . this is my code below var box = SCNBox(width: 10, height: 10, length: 10, chamferRadius: 0) box.widthSegmentCount = 3 box.heightSegmentCount = 3 box.lengthSegmentCount = 3 let positionSource = box.getGeometrySources(for: .vertex)[0] positionSource.vectorCount positionSource.data.withUnsafeBytes{(vertexBuffer: UnsafePointer<Float>) in print("a") let a = positionSource

iOS 11 SceneKit hitTest:options: fails

无人久伴 提交于 2019-12-22 13:46:49
问题 I'm facing a difficult situation using hitTest:options: in SceneKit on iOS 11. In a maping application I have a terrain node. Using hitTest:options: I was able for long to spot a point on the terrain from a touch on the screen. It still work as expected with released binary on iOS 11, and also on Xcode 9 compiled binary for iOS 10 simulator. But iOS 11 binary on iOS 11 SDK gives totaly eratic results. Return array from hitTest:options: may contain no result or too many. Moreover, most of the