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
Filter by
Sorted by
Tagged with
87 votes
2 answers
6k views

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 ...
jcr's user avatar
  • 878
86 votes
1 answer
45k views

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 ...
rmLuma's user avatar
  • 979
86 votes
2 answers
4k views

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 ...
Guig's user avatar
  • 9,958
45 votes
2 answers
41k views

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 = ...
utiq's user avatar
  • 1,373
44 votes
6 answers
34k views

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 ...
Danny Bravo's user avatar
  • 4,610
41 votes
3 answers
39k views

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 ...
potato's user avatar
  • 4,539
38 votes
4 answers
29k views

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 ...
14wml's user avatar
  • 4,138
37 votes
3 answers
29k views

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 ...
Ryan Pfister's user avatar
  • 3,236
32 votes
5 answers
13k views

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/ ...
Steve's user avatar
  • 423
31 votes
1 answer
1k views

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: ...
halileohalilei's user avatar
29 votes
5 answers
19k views

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 ...
user1845848's user avatar
27 votes
8 answers
24k views

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 ...
Matthew's user avatar
  • 1,376
25 votes
7 answers
13k views

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 ...
Mohammad Al-Ahdal's user avatar
25 votes
3 answers
9k views

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. ...
JackyJohnson's user avatar
  • 3,116
24 votes
3 answers
18k views

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() { //...
may19c19's user avatar
  • 360
23 votes
2 answers
6k views

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 ...
ooOlly's user avatar
  • 2,057
23 votes
3 answers
4k views

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 ...
coco's user avatar
  • 3,038
22 votes
7 answers
26k views

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 ...
M-V's user avatar
  • 5,177
22 votes
1 answer
717 views

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 ...
Bob5421's user avatar
  • 8,591
22 votes
1 answer
1k views

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 ...
nightbird's user avatar
  • 341
22 votes
2 answers
3k views

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 ...
Dead Pixel's user avatar
21 votes
9 answers
9k views

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 ...
Darren's user avatar
  • 269
20 votes
8 answers
20k views

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 ...
Tim Andrews's user avatar
20 votes
7 answers
8k views

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 ...
KNV's user avatar
  • 641
20 votes
3 answers
20k views

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's user avatar
20 votes
2 answers
4k views

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 ...
Max's user avatar
  • 2,739
20 votes
1 answer
14k views

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 ...
Jason Leach's user avatar
  • 4,099
19 votes
1 answer
3k views

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 ...
Maciej Kozieł's user avatar
19 votes
3 answers
11k views

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 ...
ptoinson's user avatar
  • 2,032
19 votes
1 answer
6k views

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()....
n.by.n's user avatar
  • 2,458
18 votes
5 answers
28k views

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 ...
Maury Markowitz's user avatar
18 votes
3 answers
27k views

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 ...
Clay's user avatar
  • 1,741
18 votes
1 answer
7k views

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's user avatar
18 votes
2 answers
6k views

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 ...
egghese's user avatar
  • 2,213
17 votes
3 answers
28k views

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 ...
Newalp's user avatar
  • 783
17 votes
1 answer
929 views

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 ...
pushmatrix's user avatar
16 votes
11 answers
18k views

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 ...
user160632's user avatar
16 votes
1 answer
5k views

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 ...
Kashif's user avatar
  • 4,562
16 votes
3 answers
18k views

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 ...
Clay's user avatar
  • 1,741
16 votes
1 answer
2k views

Adding a SCNBillboardConstraint makes the node disappear

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, ...
Cyupa's user avatar
  • 1,126
15 votes
1 answer
13k views

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....
T Neate's user avatar
  • 403
15 votes
2 answers
12k views

Which format file for 3d model SceneKit/ARKit better to use

I read several tutorials how to place 3d objects in SceneKit/ARKit applications and all of them uses .scn format files for the objects. But I found there is no any issues if I use original .dae ...
wm.p1us's user avatar
  • 2,039
15 votes
2 answers
7k views

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 ...
Zack's user avatar
  • 1,607
15 votes
3 answers
2k views

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 ...
Konrad Wright's user avatar
15 votes
2 answers
3k views

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 = ...
larva's user avatar
  • 5,108
15 votes
6 answers
12k views

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 ...
Takeshi Yokemura's user avatar
14 votes
1 answer
5k views

How to write a sceneKit shader modifier for a dissolve in effect

I'd like to build a dissolve in effect for a Scenekit game. I've been looking into shader modifiers since they seem to be the most light weight and haven't had any luck in replicating this effect: ...
soCohesive's user avatar
14 votes
3 answers
9k views

SwiftUI - how to add a Scenekit Scene

How can I add a Scenekit Scene to a SwiftUI view? I tried the following Hello World, using the standard Ship Scene example... import SwiftUI import SceneKit struct SwiftUIView : View { var body:...
Mane Manero's user avatar
  • 3,437
14 votes
3 answers
13k views

Including textures when exporting from Blender to COLLADA/.dae format for use in SceneKit

I am able to export meshes created in Blender for use in SceneKit by using the COLLADA/.dae format - however no textures show up on iOS device. Also, Preview on OS X won't open any COLLADA file ...
Jonny's user avatar
  • 16.1k
14 votes
1 answer
4k views

Xcode 6.1 Swift issue - 'init()' is unavailable: superseded by import of -[NSObject init]

I have just upgraded my Xcode to 6.1 an am now getting a strange compilation error. 'init()' is unavailable: superseded by import of -[NSObject init] I am subclassing SCNNode and have a optional ...
BassetMan's user avatar
  • 461

1
2 3 4 5
83