arkit

Getting SCNNode Bounding Size in Meters

限于喜欢 提交于 2019-12-24 06:38:09
问题 I'm trying to wrap an SCNPlane around a SCNNode. I'm using ARKit so everything is measured in meters, but when I get the boundingBox , I get measurements in some other unit. I looked at Apple's documentation, and they don't specify what the units are. For example, one of nodes is roughly 3 meters wide, but it says its 26 units. I could do a rough division to get a constant and use that to do the unit conversions, but I was wondering if there's a less hacky way to do it? let textContainerSize

Directional Light is affected by Camera's movement

独自空忆成欢 提交于 2019-12-24 00:42:39
问题 I want to achieve the shadows effect like in IKEA Place, where the shadow is stick with the virtual object. Here is my implementation. I added the direction light and shadow plane to the virtual object. When I moved the virtual object in the scene, shadow is not positioned right under the bottom of the virtual object. Here is my code: func setupShadows() { let flourPlane = SCNFloor() let groundPlane = SCNNode() let groundMaterial = SCNMaterial() groundMaterial.lightingModel = .constant

ARKit add 2D Video flipped by X

坚强是说给别人听的谎言 提交于 2019-12-24 00:38:46
问题 So I have following code to create custom wall let wall = SCNPlane(width: CGFloat(distance), height: CGFloat(height)) wall.firstMaterial = wallMaterial() let node = SCNNode(geometry: wall) // always render before the beachballs node.renderingOrder = -10 // get center point node.position = SCNVector3(from.x + (to.x - from.x) * 0.5, from.y + height * 0.5, from.z + (to.z - from.z) * 0.5) node.eulerAngles = SCNVector3(0, -atan2(to.x - node.position.x, from.z - node.position.z) - Float.pi * 0.5, 0

Why Update Function not working in UnityARHitTestExample of UnityARWorldMap Scene in Unity?

孤街浪徒 提交于 2019-12-23 22:13:04
问题 I am working on UnityARWorldMap to create persistance in unity.So I place the models in real world, save them and later load them.When I click Load() in WorldMapManager.cs the update function in UnityARhitTestExample stops updating.The WorldMapManager script is given below. public void Save() { //Saving the data into Application.persistentDataPath } public void Load() { //Loads the data from Application.persistentDataPath Debug.LogFormat("Loading ARWorldMap {0}", path); var worldMap =

SceneKit: Material Preview is always black

强颜欢笑 提交于 2019-12-23 18:58:42
问题 In Xcode, I have a .SCN file that was transformed from a .DAE file. I've worked with the person who made the model to set all of the Physically Based (PBR) settings. But no matter what I do, the preview is always black. Also, if I change the environment to Procedural Sky the model will also display as black. I'm aware that adding a light to the scene will "fix" this, but should I have to do that? Since it gives my models unrealistic shadows? 回答1: I changed the Illumination settings to be the

What is mean by Screen space in ARKit?

折月煮酒 提交于 2019-12-23 17:37:20
问题 When I went through the video for session 805, Creating Great AR Experiences, and they mention using screen space text when displaying text in AR. They use the example of their Measure app that works quite well. I want to achieve similar functionality. But, I am not able to figure it out. 回答1: Screen Space is the 2D pixel coordinate system of your display. It's where you normally do things like laying out UIKit widgets in screen space, etc. The alternative to Screen Space is a 3D coordinate

Xcode Error: AR reference image must have non zero positive width

我们两清 提交于 2019-12-23 07:39:10
问题 Help I'm playing around with ARKit's Image detection and I have no idea why every image I place in the AR Reference folder has an error: AR reference image 'name' must have non zero positive width I'm not really sure what that means and I'm not having any luck when I google it. How do i fix this? 回答1: When you add an AR reference image to your asset catalog, you need to add a physical size: This is necessary for ARKit to locate the image in the user's physical environment — otherwise it can't

How can I get 4 vertices's coordinate of the virtual plane?

社会主义新天地 提交于 2019-12-23 06:31:32
问题 I made the virtual plane (SCNPlane) based on real table through Scenekit. Additionally, I want to know 4 vertices's coordinate of the virtual plane. Click here to see image. 回答1: You can get the coordinates of the bounding box, just as BlackMirrorz said. let (min, max) = planeNode.boundingBox This will give you opposite corners (min and max) as SCNVector3 objects. Those coordinates will be relative to the object , unrotated, untranslated, and unscaled. Derive the other two corner coordinates

Get download progress from SCNScene url

怎甘沉沦 提交于 2019-12-23 05:12:16
问题 I'm working with ARKit, I have trouble getting download progress from SCNScene url. This is my code: func downloadModel(hitTestResult: ARHitTestResult) { DispatchQueue.global().async { // create loading view // I WANT TO GET DOWNLOAD PROGRESS HERE let loading = UIAlertController(title: nil, message: "Please wait...\(downloadProgressValueHere)%", preferredStyle: .alert) let loadingIndicator = UIActivityIndicatorView(frame: CGRect(x: 10, y: 5, width: 50, height: 50)) loadingIndicator

How to disabled some default functionality in Scene view when allowsCameraControl = true?

拜拜、爱过 提交于 2019-12-23 04:33:48
问题 Please Help me, I have setup "allowsCameraControl = true" in Scene view. How to disabled some default functionality. 
 Ex : Pan with two fingers to translate the camera on its local xy-plane scnview.allowsCameraControl = true scnview.defaultCameraController.interactionMode = .orbitTurntable scnview.defaultCameraController.inertiaEnabled = true scnview.defaultCameraController.maximumVerticalAngle = 69 scnview.defaultCameraController.minimumVerticalAngle = -69 scnview.autoenablesDefaultLighting