Questions tagged [scenekit]

Apple SceneKit is a high-level framework for 3D data visualizations and casual games on iOS, macOS, iPadOS, tvOS and watchOS. Since 2017, SceneKit is used as an ARKit companion and a main render engine for AR apps.

SceneKit is an Apple framework for constructing, animating and rendering 3D scenes. It was introduced in 2012 on Mac OS X 10.8 Mountain Lion, then became available in 2014 for iOS 8, and was a part of the original release of tvOS 9.0 in 2015.

SceneKit provides a Swift and Objective-C interface that abstracts away lower level interactions with Metal, and has tight integration with other frameworks like ARKit and CoreAnimation. It includes a comprehensive game physics engine. It can be integrated with SpriteKit (Apple's 2D gaming engine) or used on its own. Since 2018 SceneKit reads in Pixar USDZ file format that supports Physically Based Rendering (PBR) and asset animation.

Documentation for this framework can be found in the SceneKit Reference from Apple.

4072 questions
23
votes
3 answers

Mapping image onto 3D face mesh

I am using the iPhone X and ARFaceKit to capture the user's face. The goal is to texture the face mesh with the user's image. I'm only looking at a single frame (an ARFrame) from the AR session. From ARFaceGeometry, I have a set of vertices that…
coco
  • 2,998
  • 1
  • 35
  • 58
23
votes
2 answers

What does the "simd" prefix mean in SceneKit?

There is a SCNNode category named SCNNode(SIMD), which declares some properties like simdPosition, simdRotation and so on. It seems these are duplicated properties of the original/normal properties position and rotation. @property(nonatomic)…
ooOlly
  • 1,997
  • 21
  • 31
22
votes
1 answer

Removing SCNNode nodes from scene.rootNode is causing a crash, in SceneKit

I am trying to remove set of nodes from my scene which represent a path. They are a combination of SCNSphere geometry nodes, and custom geometry representing lines, created using SCNGeometrySource and SCNGeometryElement. I am not retaining these…
nightbird
  • 331
  • 2
  • 6
22
votes
1 answer

SceneKit Cocoa snapshot failed assertion

I am working on a Swift/Cocoa/Xcode application. This application contains a SceneKit View. The rendering API is set to Default (I think this is Metal). If I run a snapshot() on this SceneKit view object, I get this error message. What I want to do…
Bob5421
  • 7,757
  • 14
  • 81
  • 175
22
votes
2 answers

SceneKit's performance with a cube test

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…
Dead Pixel
  • 433
  • 4
  • 9
22
votes
7 answers

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

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…
M-V
  • 5,167
  • 7
  • 52
  • 55
21
votes
9 answers

Extracting vertices from scenekit

I'm having a problem with understanding scenekit geometery. I have the default cube from Blender, and I export as collada (DAE), and can bring it into scenekit.... all good. Now I want to see the vertices for the cube. In the DAE I can see the…
Darren
  • 269
  • 3
  • 8
20
votes
1 answer

Scale SCNNode in SceneKit

I have the following SCNNode: let box = SCNBox(width: 10.0, height: 10.0, length: 10.0, chamferRadius: 0) let boxNode = SCNNode(geometry: box) boxNode.position = SCNVector3(x: 0, y: 0, z: 0) If I apply: boxNode.scale = SCNVector3(x: 0.5, y: 0.5, z:…
Jason Leach
  • 3,889
  • 7
  • 37
  • 54
19
votes
7 answers

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

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…
KNV
  • 631
  • 4
  • 19
19
votes
1 answer

How To Apply .MTL File on .OBJ 3d Model via SceneKit & Model I/O

I am trying to apply an .mtl file texture on .obj 3d model via SceneKit & Model I/0. My code below works fine when I try to apply .jpg of a texture on it: let url = NSBundle.mainBundle().URLForResource("chair", withExtension: "obj") …
n.by.n
  • 2,458
  • 22
  • 31
19
votes
2 answers

SceneKit - Threads - What to do on which thread?

When using SceneKit, the update method: func renderer(aRenderer: SCNSceneRenderer, updateAtTime time: NSTimeInterval) is not called on the main thead, but on some other thread. What am I supposed to do on the main thread, and what has to be…
Max
  • 2,699
  • 2
  • 27
  • 50
19
votes
3 answers

How to use iOS (Swift) SceneKit SCNSceneRenderer unprojectPoint properly

I'm developing some code using SceneKit on iOS and in my code I want to determine the x and y coordinates on the global z plane where z is 0.0 and x and y are determined from a tap gesture. MY setup is as follows: override func viewDidLoad() { …
ptoinson
  • 2,013
  • 3
  • 21
  • 30
18
votes
3 answers

What 3D model formats are supported by ARKit?

What 3D model formats are supported by ARKit? Does someone know all supported formats for using in ARKit, and which format Xcode can export to use in app?
user3371261
  • 185
  • 1
  • 1
  • 5
18
votes
1 answer

SceneKit: Diffuse Alpha vs. Transparency / Transparent

I am trying to achieve transparency for a mesh in SceneKit on iOS. I am confused by the documentation as there seem to be multiple ways to make a mesh transparent: Use alpha channel of UIColor via…
Christopher Oezbek
  • 23,994
  • 6
  • 61
  • 85
18
votes
5 answers

Position a SceneKit object in front of SCNCamera's current orientation

I would like to create a new SceneKit node when the user taps the screen, and have it appear directly in front of the camera at a set distance. For testing, this will be a SCNText reads reads "you tapped here". It should also be at right angles to…
Maury Markowitz
  • 9,082
  • 11
  • 46
  • 98