SCNScene is a part of the SceneKit Framework. An SCNScene object is a container for the node hierarchy and global properties that together form a displayable 3D scene.
Questions tagged [scnscene]
91 questions
1
vote
2 answers
SceneKit - adding SCNNode on another SCNNode
I'm trying to put sphere on top of the box, but the position is strange: Ball is half hidden inside box. I tried to change box and sphere pivot, but it didn't help. Here's the code:
let cubeGeometry = SCNBox(width: 10, height: 10, length: 10,
…

Timur Mustafaev
- 4,869
- 9
- 63
- 109
1
vote
0 answers
Rotation of node object to initial position SCNScene in iOS
I have 3d model of skeleton which is i am using as a node in my application. I rotate it using UIPanGesture with this code
- (void)handleSingleTap:(UIPanGestureRecognizer *)recognizer
{
CGPoint location = [recognizer…

baydi
- 13
- 3
1
vote
1 answer
Is it possible to have "update(_ currentTime: TimeInterval)" in SCNScene or SCNNode the same way as SKScene?
I'm working on an iOS game that will require the use of both SceneKit & SpriteKit & was wondering about the Render/update loop function.
I will be using a SpawnController class to spawn different types of objects & they will be based on the time…

victorMaje
- 33
- 6
1
vote
1 answer
SceneKit: move SCNNode by setting velocity property directly like in SpriteKit?
In SpriteKit, it's possible to move nodes by directly setting their velocity property.
This doesn't seem to work in SceneKit, however. Setting velocity -- both in game loop callbacks and outside of game loop functions -- seems to have no…

Crashalot
- 33,605
- 61
- 269
- 439
1
vote
1 answer
SceneKit: orbit around arbitrary point without camera jumping or shifting anchor point to center?
The goal is to orbit around an arbitrary, but visible, point in a scene.
As the user pans, the camera should move and rotate around this anchor point.
This works wonderfully if the anchor point is in the middle of the screen.
However, if the anchor…

Crashalot
- 33,605
- 61
- 269
- 439
0
votes
0 answers
Swift: Load a .dae model into SCNScene to use in ARSCNView
I created a method that downloads models from Firebase. I can check with this code, that soda.dae is in the cache folder.
Get cached models:
guard let cacheDirectory = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask).first else…

Gergő Csiszár
- 107
- 1
- 6
0
votes
0 answers
Adding CIFilters to selfie camera feed from ARSCNView
I'm setting up my ARScene using this code which works perfectly. I'm then trying to apply a CIFilter to the selfie camera feed and set it back in real time. The only way I can access the camera feed data is through the -session didUpdateFrame method…

IamRob
- 35
- 6
0
votes
1 answer
Placing SCNScene on the other SCNScene
I am trying to built an app where you can place dices at the table, that spawns automatically if the app detects horizontal plane. I will explain the problem after the code:
import UIKit
import SceneKit
import ARKit
class ViewController:…
user19727360
0
votes
1 answer
Finding a better method to identify points exist "inside" of a cube in swift
I want to find a way to check if points(vectors) in my scene are contained within a SCNBox I have displayed on screen. Currently I have an array of about 83000 SCNVector3's. So far, I do this by simply running a for loop on each point and checking…

7ucci
- 1
0
votes
0 answers
SceneKit error: C3DParticleModifier_PhysicsField - no aether
I'm making a 3D game in Swift. When I add SCNParticleSystem to a node in a scene, as soon as the scene disappears and switches to another scene, the console gives me the output:
[SceneKit] Error: C3DParticleModifier_PhysicsField - no ether
I cannot…

mptaurus
- 21
- 4
0
votes
1 answer
SCNFloor goes unvisible randomly on SceneKit
I get AR object from an API call and store then in the file manager storage, during this process, I merged all the nodes in the one node, and also add an SCNFloor below the object:
let mergedScene = SCNScene()
let nodeContainer =…

martin wotterman
- 195
- 7
0
votes
1 answer
Changing scene view lighting model programmatically
I am loading a 3D model using SCNScene in SwiftUI, my object looks better in lambert or phong shading. I am trying to change the lighting model like this:
var scene: SCNScene? {
let scene = SCNScene(named: "model.usdz")
…

Mc.Lover
- 4,813
- 9
- 46
- 80
0
votes
1 answer
Get an URL from SCNScene
In the apple example code for ARKit, they provided a VirtualObjectclass that load Scn files from Models.scnassets.
static let availableObjects: [VirtualObject] = {
let modelsURL = Bundle.main.url(forResource: "Models.scnassets", withExtension:…

Martin sku
- 101
- 7
0
votes
0 answers
Remove complete .scn instead of individual nodes Swift ARKit
I am attempting to delete the .scn objects I placed down. However, with my current code, it is just deleting individual nodes. Here is how I handle the tap delete.
@objc func Erase(sender: UITapGestureRecognizer){
print("rendering")
…

Brandan B
- 464
- 2
- 6
- 21
0
votes
1 answer
How to share .scn file as .usdz file?
I am creating an app where users can scan objects in 3D, I have a scene which I can easily save in documents directory and share it in .scn format, but I want to share this .scn file as .usdz file via UIActivityController.
Basically I am using this…