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
87
votes
2 answers

iOS revert camera projection

I'm trying to estimate my device position related to a QR code in space. I'm using ARKit and the Vision framework, both introduced in iOS11, but the answer to this question probably doesn't depend on them. With the Vision framework, I'm able to get…
Guig
  • 9,891
  • 7
  • 64
  • 126
87
votes
2 answers

How to create a SceneKit SCNSkinner object in code?

I have a Swift app using SceneKit for iOS 8. I load a scene from a .dae file that contains a mesh controlled by a skeleton. At runtime, I need to modify the texture coordinates. Using a transform is not an option -- I need to compute a different,…
jcr
  • 878
  • 6
  • 7
71
votes
1 answer

RealityKit vs SceneKit vs Metal – High-Quality Rendering

I'm creating an iOS app that I intend to display realistic/high-quality renders within AR. Whilst experimenting with these 3 options, I'm still unsure which of them I should go forward with developing my app's framework around: SceneKit, RealityKit…
rmLuma
  • 829
  • 1
  • 6
  • 4
43
votes
2 answers

Unable to activate constraint with anchors

So, I'm trying to create a sceneView programatically class ViewController: UIViewController, ARSCNViewDelegate { var sceneView: ARSCNView = ARSCNView() let configuration = ARWorldTrackingConfiguration() override func viewDidLoad()…
utiq
  • 1,342
  • 2
  • 17
  • 33
43
votes
6 answers

Rotate SCNCamera node looking at an object around an imaginary sphere

I've got an SCNCamera at position(30,30,30) with a SCNLookAtConstraint on an object located at position(0,0,0). I'm trying to get the camera to rotate around the object on an imaginary sphere using A UIPanGestureRecognizer, while maintaining the…
Danny Bravo
  • 4,534
  • 1
  • 25
  • 43
41
votes
3 answers

how to convert .dae to .scn files in SceneKit

This is a screenshot from Apple's Fox sample code. As you can see, they use .scn file format for graphics object. They explicitly state in the wwdc2015 video that this was done by an artist. So far I only worked with .dae and was until recently…
potato
  • 4,479
  • 7
  • 42
  • 99
37
votes
3 answers

ARKit – Get current position of ARCamera in a scene

I'm in the process of learning both ARKit and Scenekit concurrently, and it's been a bit of a challenge. With a ARWorldTrackingSessionConfiguration session created, I was wondering if anyone knew of a way to get the position of the user's 'camera'…
Ryan Pfister
  • 3,176
  • 4
  • 24
  • 26
37
votes
4 answers

How to create realistic .scn files?

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…
14wml
  • 4,048
  • 11
  • 49
  • 97
32
votes
5 answers

ARKit hide objects behind walls

How can I use the horizontal and vertical planes tracked by ARKit to hide objects behind walls/ behind real objects? Currently the 3D added objects can be seen through walls when you leave a room and/ or in front of objects that they should be…
Steve
  • 423
  • 1
  • 5
  • 4
31
votes
1 answer

Using a MTLTexture as the environment map of a SCNScene

I want to set a MTLTexture object as the environment map of a scene, as it seems to be possible according to the documentation. I can set the environment map to be a UIImage with the following code: let roomImage = UIImage(named:…
halileohalilei
  • 2,220
  • 2
  • 25
  • 52
29
votes
5 answers

Using SceneKit in Swift Playground

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…
user1845848
  • 653
  • 2
  • 8
  • 11
27
votes
8 answers

SceneKit – Drawing a line between two points

I have two points (let's call them pointA and pointB) of type SCNVector3. I want to draw a line between them. Seems like it should be easy, but can't find a way to do it. I see two options, both have issues: Use a SCNCylinder with a small radius,…
Matthew
  • 1,366
  • 2
  • 15
  • 28
25
votes
7 answers

Code Signing Error Whenever I try replacing stock files in new SceneKit application

So Xcode 8 was recently released and I'm still unsure as to what exactly might be causing this problem (it might be just the fact that it's a beta version of Xcode or perhaps that I'm somehow doing something incorrectly). The problem at hand is that…
Mohammad Al-Ahdal
  • 758
  • 2
  • 8
  • 21
25
votes
3 answers

What is the proper way of creating an scnassets catalog in xcode

I'm new to SceneKit and I'm just curious as to what is the proper way of creating (let alone using) the .scnassets resource catalog that gets created in the SceneKit game project template in Xcode. I know I can create a folder and give it the…
JackyJohnson
  • 3,106
  • 3
  • 28
  • 35
24
votes
3 answers

SCNBox different colour or texture on each face

I'm new to iOS development and I've got myself stumped. I am trying to render a cube using SceneKit that has a different colour for each face. This is what I've got so far: func sceneSetup() { // 1 let scene = SCNScene() // 2 let…
may19c19
  • 360
  • 1
  • 4
  • 15
1
2 3
99 100