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
2
votes
1 answer

Proper way to illuminate a 2D surface in 3D space?

EDIT: I've solved the issue below the tilde line -- the missing chunks -- by fixing an elementary error in my for-loop dealing with calculating face normals. I now have a new problem though: strange, unwanted shadows on the surface itself. Some…
Harrison
  • 69
  • 9
2
votes
0 answers

SceneKit - Rotating around a point causing strange rotation

I want to be able to rotate a camera around a cube (a collection of cubes), but for some reason, when I rotate, the rotation goes in multiple directions. I have an object that I wish to rotate around and set this as a look at constraint. This object…
Chris
  • 2,739
  • 4
  • 29
  • 57
2
votes
1 answer

How to Add SCNView on top of a SKView

I am trying to add a SCNView on top of a SKView. My hierarchy begins with a UIViewController. From there I present a SKScene on top of the UIViewController's view. Then I had added a few layers of SKSpriteNodes. Visually speaking, I want to add a…
2
votes
1 answer

Scenekit Xcode 7 positional audio

Has anyone gotten SceneKit positional audio to work in Swift using Xcode 7 and iOS 9? This is my code to add audio to a node: let spaceAudio = SCNAudioSource(fileNamed: "Arrp1.mp3") spaceAudio.positional = true …
Jess
  • 85
  • 2
  • 9
2
votes
1 answer

Odd EXC_BAD_ACCESS when calling contactTestBetweenBody

I have a 3D scene created in scene kit comprising an area surrounded by invisible walls and I want to lob physics objects into this area in such a way that they can't escape once they're in. I had a mind to achieve this in the following…
Ash
  • 9,064
  • 3
  • 48
  • 59
2
votes
1 answer

SceneKit physics add velocity in local space

I am trying to manipulate the player node using physicsBody.velocity by adding or subtracting velocity to the axis for different directions. The problem is that I'm having trouble finding the method for applying that to local space or at least…
Jess
  • 85
  • 2
  • 9
2
votes
0 answers

How to project a point to screen coordinates from an arbitrary point of view in SceneKit

For the purposes of lining up a UIView overlay and some SceneKit objects I need to project some SceneKit world coordinates to 2D view coordinates. The wrinkle is that the UIView fades in as the camera is moving to its final position, and therefore…
jawj
  • 463
  • 3
  • 11
2
votes
1 answer

How to create SpriteKit water line

I'd like to know what is the best method for creating a water line in SpriteKit or even in SceneKit (if this is a better option)? By water line I mean, an animated wavey line that indicates the level of water in a 2D game - like the game "Jumping…
AJ_
  • 311
  • 2
  • 12
2
votes
2 answers

Custom clipping plane with SceneKit

Is it possible to create a custom clipping plane while using SceneKit? Since you can provide your own shaders, the only thing I need to do is somehow enable GL_CLIP_DISTANCE0. Is this possible or do I have to stick to lower level libraries? Edit: I…
Uli Held
  • 539
  • 4
  • 7
2
votes
0 answers

ambient light excludes 1 object from getting affected

Is it possible to specify which nodes the light source affects? I would like to use ambient light but exclude 1 object from getting affected. I did the the homework and the appropriate property looks like categoryBitMask. I followed this answer at…
potato
  • 4,479
  • 7
  • 42
  • 99
2
votes
3 answers

linearGravityField() is not affecting physics bodies in the scene SceneKit

I'm trying to use a SCNPhysicsField.linearGravityField object to affect only specific objects in my scene. The problem is, that I can't seem to get it to affect anything. Here's a sample of my code in Swift: let downGravityCatagory = 1 << 0 let…
tedesignz
  • 185
  • 1
  • 15
2
votes
0 answers

SceneKit - Render certain nodes always in foreground

Is it possible to force certain nodes to render before other nodes? E.g. I have a sphere that is moving inside a plane and I want the sphere to be always on top of the plane. At the moment half / parts of the plane sometimes flicker on top of the…
Max
  • 2,699
  • 2
  • 27
  • 50
2
votes
0 answers

Ignore sibling order in Scene Kit overlaySKScene

I am using an overlaySKScene in Scene Kit. In that SKScene, I am using a mask node to crop an SKCropNode. The mask node works perfectly when run on Mac OS X, but when I run it on iOS it doesn't work. I think that's because iOS is ignoring sibling…
2
votes
1 answer

overlapping of geometries in Scenekit

I'm have put a plane onto the same height as the edges of the cube are. Everything you see was created in Blender and you can download Blender file here. The plane is a little bigger than the hole so that they overlap. The whole rendering is a…
potato
  • 4,479
  • 7
  • 42
  • 99
2
votes
0 answers

How to use Scenekit for multimonitor / multiview rendering in macosx/ios?

I'm trying to use scenekit on osx to render a scene from different points of view at 60Hz. To do so, I have 2 different SCNView. The scene render is OK but : -> the physics engine and animation are running in both SCNViews for the common scene,…
user5057821
1 2 3
99
100