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
18
votes
8 answers

How can I remove all nodes from a scenekit scene?

Hi I am trying to remove all nodes from my Scenekit scene but I cannot for the life of me figure out a way. It seems logical to me that there must be a function for doing this automatically but I cannot find it. In context, I am trying to remove…
Tim Andrews
  • 827
  • 1
  • 7
  • 21
18
votes
2 answers

SceneKit – Mapping physical 360 rotation

I am having a hard time mapping device motion (sensor fusion) to SceneKit node rotation. The premise of the problem is as follows, I have sphere, and the camera is positioned to be inside the the sphere such that the geometric center of sphere and…
egghese
  • 2,193
  • 16
  • 26
17
votes
3 answers

How to create USDZ file using Xcode converter?

At the 2018 WWDC Apple announced the introduction of new USDZ file format. In relation to creating USDZ file the following was said: To create your own usdz files, a usdz_converter has been bundled as part of Xcode 10 beta. Its a command line tool…
Clay
  • 1,721
  • 2
  • 10
  • 18
17
votes
1 answer

Scenekit snapshot() doesn't include camera exposure settings

I'm providing screenshot functionality for my AR app, and I noticed that the screenshots I take (via sceneView.snapshot()) are much darker than what I see from the camera. I'm using the ARKit example code from Apple, and it seems like this is…
pushmatrix
  • 726
  • 1
  • 9
  • 23
17
votes
1 answer

SceneKit SCNNode init(mdlObject:) missing?

I'm using Xcode 7.3.1, Swift 2.x, iOS target is 9.3. I can find convenience init init(MDLObject mdlObject: MDLObject) in Apple docs, but I don't see it in my project. I opened standard game project starter, SceneKit is imported. I've tried: Double…
Maciej Kozieł
  • 959
  • 11
  • 24
17
votes
3 answers

SceneKit – Rotate and animate a SCNNode

I'm trying to display a pyramid that points following the z axis and then rotates on itself around z too. As my camera is on the z axis, I'm expecting to see the pyramid from above. I managed to rotate the pyramid to see it this way but when I add…
Newalp
  • 733
  • 1
  • 7
  • 11
16
votes
1 answer

Find distance between iOS Device Camera and user's face

I am trying to find distance between iOS device's front-facing camera and user's face in the real world. So far, I have tried ARKit/SceneKit, and using ARFaceAnchor I am able to detect user's face distance from camera; but it works only in close…
Kashif
  • 4,642
  • 7
  • 44
  • 97
16
votes
3 answers

How to create a .usdz animation?

You can now convert 3D models to .usdz files (uncompressed zip archive) using Apple's command line tool bundled with Xcode 10 beta. Example code to convert an .obj file to .usdz: xcrun usdz_converter magnifying_glass.obj -g frame…
Clay
  • 1,721
  • 2
  • 10
  • 18
16
votes
1 answer

Adding a SCNBillboardConstraint makes the node dissapear

After what I've read in the documentation and on the internet a SCNBillboardConstraint would rotate a node to always face the pointOfView node - in the case of ARKit, the user's camera. The thing is, when I add a SCNBillboardConstraint to a child…
Cyupa
  • 1,126
  • 13
  • 37
16
votes
11 answers

How can I export DAE files for use in Scene Kit without seeing "untitled-animations"?

I am trying to load animations created in Cheetah 3D and Blender 3D into Scene Kit, but all I get is a bunch of "untitled-animations" with each one being the same animation. Does anyone know how to properly export these from Blender or Cheetah 3D…
user160632
  • 347
  • 1
  • 4
  • 13
15
votes
2 answers

Understanding ARKit World Transform Matrices

In ARKit, when I perform a hit-test, I get back an instance of ARHitTestResult. One of the properties of this is worldTransform, which I understand contains a 4x4 transformation matrix of the position of the object – simd_float4x4. As someone who is…
Zack
  • 1,585
  • 1
  • 18
  • 29
15
votes
6 answers

How to record video from ARKit?

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 //…
Takeshi Yokemura
  • 425
  • 1
  • 4
  • 17
15
votes
2 answers

soft shadow, shadow blur in SceneKit

I add one node and try to setting shadow blur with SceneKit here's my light config, I did try to set shadowRadius light = [SCNLight light]; light.type = SCNLightTypeDirectional; light.castsShadow = true; light.shadowMode =…
larva
  • 4,687
  • 1
  • 24
  • 44
15
votes
3 answers

Throttle CPU usage on background thread

I have a CPU intensive task and I want it to use less CPU and take up more time. I'm loading a massive amount of SCNNodes to a scene at start-up. It takes up a lot of memory, and I'd like it to work on it at a safe rate instead of lagging up my…
Konrad Wright
  • 1,254
  • 11
  • 24
15
votes
1 answer

How to set up SceneKit collision detection

Hello I have pored over the documentation and can not figure out how to set up collision detection in scene kit. Can some one please show an example. Please help I am very desperate to figure this out. Thank you! Edit: Hello Thank you very much, I'm…
T Neate
  • 403
  • 2
  • 6
  • 18