scenekit

How do you load a .dae file into an SCNNode in iOS SceneKit?

你离开我真会死。 提交于 2019-12-03 03:47:29
问题 I am having trouble understanding how geometry from .dae files should be loaded into an iOS SceneKit scene graph. I know that you can load .dae files directly into an SCNScene: // create a new scene let scene = SCNScene("test.scnassets/test.dae") I also know that you can create an empty SCNScene and add built-in 3D objects into it as child nodes: let scene = SCNScene() var sphereNode = SCNNode() sphereNode.geometry = SCNSphere(radius: 1.0) scene.rootNode.addChildNode(sphereNode) In the second

Using SceneKit in Swift Playground

荒凉一梦 提交于 2019-12-03 03:13:28
问题 I've looked everywhere for this but I'm coming up blank. How do you replicate what Chris Lattner was demonstrating with Playgrounds and SceneKit at WWDC? I want to have a SceneKit scene, animating, in Playgrounds. I tried cutting and pasting the setup code from the SceneKit project template, thinking it would magically start rendering, but it does not. I tried watching the keynote and pausing and zooming on on Lattner's screen looking for hints at the source code, but he appeared to be

Scene Kit Performance with cube test

▼魔方 西西 提交于 2019-12-03 02:12:30
In learning 3d graphics programming for games I decided to start off simple by using the Scene Kit 3D API. My first gaming goal was to build a very simplified mimic of MineCraft. A game of just cubes - how hard can it be. Below is a loop I wrote to place a ride of 100 x 100 cubes (10,000) and the FPS performance was abysmal (~20 FPS). Is my initial gaming goal too much for Scene Kit or is there a better way to approach this? I have read other topics on StackExchange but don't feel they answer my question. Converting the exposed surface blocks to a single mesh won't work as the SCNGeometry is

How to create realistic .scn files?

风流意气都作罢 提交于 2019-12-03 01:41:35
问题 Looking at the apple sample AR app, there are many realistic looking objects (cup, candle, etc). However working with the scene kit editor on Xcode it is clear that this only allows you to create basic objects. My question is, what software/file can be used to create realistic scn objects? I'm sure that there is software that allows you to create 3D models and covert them to scn files. I just don't know which software to use or what files can be converted to scn Note: I understand that this

Get “[SceneKit] Error:” when set AVPlayer to SCNMaterial.diffuse.contents

匿名 (未验证) 提交于 2019-12-03 01:33:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: According Apple's docs, SCNMaterial.diffuse.contents can be a AVPlayer . In this case material appear content of video. Everything seems ok but I get several sceneKit error logs: [SceneKit] Error: Could not get pixel buffer (CVPixelBufferRef) Below is my code. Move [_player play] to viewWillAppear does't help. - (void)viewDidLoad { [super viewDidLoad]; self.boxNode = [self.sceneView.scene.rootNode childNodeWithName:@"box" recursively:YES]; NSString *path = [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/VRF_SuLie.MP4"];

SceneKit – Get direction of camera

好久不见. 提交于 2019-12-03 00:44:53
I need to find out which direction a camera is looking at, e.g. if it is looking towards Z+ , Z- , X+ , or X- . I've tried using eulerAngles , but the range for yaw goes 0 -> 90 -> 0 -> -90 -> 0 which means I can only detect if the camera is looking towards Z or X , not if it's looking towards the positive or negative directions of those axes. You can create an SCNNode that place it in worldFront property to get a vector with the x, y, and z direction. Another way you could do it is like how this project did it: // Credit to https://github.com/farice/ARShooter func getUserVector() ->

How to record video from ARKit?

风流意气都作罢 提交于 2019-12-02 22:25:24
Now I'm testing ARKit/SceneKit implementation. The basic rendering to the screen is kinda working so then I wanna try recording what I see on the screen into a video. Just for recording of Scene Kit I found this Gist : // // ViewController.swift // SceneKitToVideo // // Created by Lacy Rhoades on 11/29/16. // Copyright © 2016 Lacy Rhoades. All rights reserved. // import SceneKit import GPUImage import Photos class ViewController: UIViewController { // Renders a scene (and shows it on the screen) var scnView: SCNView! // Another renderer var secondaryRenderer: SCNRenderer? // Abducts image data

App Crashs on Touch of the screen Scenekit with a overlayskscene Xcode Swift

独自空忆成欢 提交于 2019-12-02 18:44:48
问题 Hey ok what is the best way to recognize touch for a HUD on a scene kit 3D game on a Overlayskscene. because i have a button called "AButton" but when ever i touch the Button or the screen the game crashes after hours of search I'm guessing the problem is the touchbegin on the scene kit don't exactly get along. But then how do i make it so that when a user touches a button on the HUD it doesn't crash the system and it actually works. can you look at my code and rewrite it. do i use touches

Check whether the ARReferenceImage is no longer visible in the camera's view

耗尽温柔 提交于 2019-12-02 17:15:23
I would like to check whether the ARReferenceImage is no longer visible in the camera's view. At the moment I can check if the image's node is in the camera's view, but this node is still visible in the camera's view when the ARReferenceImage is covered with another image or when the image is removed. func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) { guard let node = self.currentImageNode else { return } if let pointOfView = sceneView.pointOfView { let isVisible = sceneView.isNode(node, insideFrustumOf: pointOfView) print("Is node visible: \(isVisible)") } } So I

Using SceneKit in Swift Playground

徘徊边缘 提交于 2019-12-02 16:38:58
I've looked everywhere for this but I'm coming up blank. How do you replicate what Chris Lattner was demonstrating with Playgrounds and SceneKit at WWDC? I want to have a SceneKit scene, animating, in Playgrounds. I tried cutting and pasting the setup code from the SceneKit project template, thinking it would magically start rendering, but it does not. I tried watching the keynote and pausing and zooming on on Lattner's screen looking for hints at the source code, but he appeared to be importing all his code from elsewhere in his project, so it gave me no clues. There does not seem to be