Questions tagged [scnnode]

SCNNode is a part of the SceneKit Framework. An SCNNode object represents a portion of a scene graph.

SCNNode is a part of the SceneKit Framework. An SCNNode object represents a portion of a scene graph. A node by itself has no visible content when the scene containing it is rendered—it represents only a position in space (and transformation of coordinate spaces) relative to its parent node. To construct a scene, you use a hierarchy of nodes to create its structure, then add lights, cameras, and geometry to nodes to create visible content.

372 questions
33
votes
1 answer

ARKit SKVideoNode Playing on Render

Main Problem: I am adding this section AFTER to clarify the problem. -- I can PAUSE my video (I do not want it playing on a loop). When my node comes into sight, my node plays my video, even if it is on pause. If my video has finished playing, and…
impression7vx
  • 1,741
  • 1
  • 14
  • 42
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
  • 349
  • 1
  • 3
  • 14
15
votes
6 answers

ARKit Place a SCNNode facing the camera

I'm using ARKit to display 3D objects. I managed to place the nodes in the real world in front of the user (aka the camera). But I don't manage to make them to face the camera when I drop them. let tap_point=CGPoint(x: x, y: y) let…
Marie Dm
  • 2,447
  • 2
  • 18
  • 35
13
votes
2 answers

Load large 3d Object .scn file in ARSCNView Aspect Fit in to the screen ARKIT Swift iOS

I am developing ARKit Application using 3d models. So for that I have used 3d models & added gestures for move, rotate & zoom 3d models. Now I am facing only 1 issue but I am not sure if this issue relates to what. Is there an issue in 3d model or…
Mayur
  • 5,004
  • 7
  • 34
  • 62
13
votes
2 answers

cameranode rotate as iOS device moving

It's 360 degree video player project. I add a cameranode(SCNNode) to a rootnode, the cameranode was put at the center(0,0,0) of the SCNSphere, It can play video by now. Now I have to use devicemotion. I need to rotate the camera when device moves.…
ronan
  • 1,531
  • 11
  • 20
10
votes
2 answers

Persistence of SCNAudioPlayer on SCNNodes in Xcode Instrument

I have created a subclass of SCNNode. It is made up of few child nodes. I have declared a method, viz. soundCasual() which adds a SCNAudioPlayer to the instance of this class. Everything is working as expected and audio is being played, when this…
Manganese
  • 610
  • 5
  • 22
10
votes
2 answers

ARkit - Loading .scn file from Web-Server URL in SCNScene

I am using ARKit for my application and I try to dynamically load .scn files from my web-server(URL) Here is a part of my code let urlString = "https://da5645f1.ngrok.io/mug.scn" let url = URL.init(string: urlString) let request =…
Raj
  • 475
  • 8
  • 18
9
votes
3 answers

Swift: "Must call a designated initializer of the superclass" error even though code is doing so

The goal is to subclass SCNNode. According to the class docs, init(geometry geometry: SCNGeometry?) is a designated initializer (no convenience keyword listed), so isn't this code invoking a designated initializer of its superclass? Why is Xcode…
Crashalot
  • 31,452
  • 56
  • 235
  • 393
9
votes
1 answer

Import 3D object with animation from scn

I've imported a DAE file in XCode and converted it into a SCN file. This file contains some 3D objects with animations. I'm trying to import all the nodes with their animations and play them on the scene. The nodes are imported but I can't get the…
user623396
  • 1,487
  • 1
  • 16
  • 38
9
votes
2 answers

Stroke Width with a SceneKit line primitive type

I am trying to replicate this cube image shape (with permission from the original creator) using scene kit. Thus far, I have the drawing code for the lines and the vertices. I cannot use an image because the background has to be transparent. The…
coneybeare
  • 33,248
  • 21
  • 128
  • 182
8
votes
2 answers

How to change orientation of a SCNNode to the Camera with ARKit

The code below places a SCNPlane onto the point touched, but the plane is oriented (rotated) to the position that the phone was in when the app started. I would ideally like to orient the Node to a physical wall or to the current orientation of the…
Rob Schlackman
  • 279
  • 3
  • 6
8
votes
3 answers

adding a border around SceneKit node

i am trying to highlight a selected node in SceneKit with a tap gesture. Unfortunately, I have not been able to accomplish it. The best thing I could do was to change the material when the node is tapped. let material =…
user4432964
8
votes
2 answers

SceneKit – Custom geometry does not show up

I should see 2 yellow triangles, but I see nothing. class Terrain { private class func createGeometry () -> SCNGeometry { let sources = [ SCNGeometrySource(vertices:[ SCNVector3(x: -1.0, y: -1.0, z: 0.0), …
Stéphane de Luca
  • 10,239
  • 7
  • 45
  • 74
7
votes
3 answers

How to create a SCNNode from a .usdz?

I have downloaded the .usdz models provided by Apple: https://developer.apple.com/arkit/gallery/ But now, I want to create a SCNNode with one of these models, so I am doing this to obtain the node: guard let urlPath = Bundle.main.url(forResource:…
Sergio
  • 887
  • 7
  • 22
7
votes
1 answer

ARKit - How to load .scn and texture file from server URL

I try to load dynamically .scn and texture files from server URL in ARKit application. I have achieved loading .scn file from web url this way.. But after running I am not seeing any textures on device. I get following error message.…
Raj
  • 475
  • 8
  • 18
1
2 3
24 25