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.

401 questions
2
votes
1 answer

Object is not rendering/drawing using triangles and coordinates, SceneKit

The problem is that I can't render anything if I create SCNGeometry using this constructor init(sources: [AnyObject], elements: [AnyObject]?) Here is an example (this should draw a cube, taken from this tutorial): func test() { var…
prvit
  • 956
  • 3
  • 9
  • 22
2
votes
1 answer

SceneKit, test if SCNNode completely visible

I have a 2 SCNNode next to each other ( 1 big box and 1 small box ). I rotate its parent so that the small box sometimes is not visible any more in the camera, is it possible to know when the small box is not visible anymore because its behind the…
Andy Jacobs
  • 15,187
  • 13
  • 60
  • 91
2
votes
2 answers

Using SceneKit for hitTesting not returning a hit with SCNNode

The documentation in XCode clearly states that hitTesting a geometry in SceneKit can be done with SCNRender, SCNView or the SCNNode themselves when one plans to test a 3D line segment. I have a use for SCNScene with its nodes without a renderer or…
Daniel
  • 578
  • 4
  • 17
2
votes
2 answers

Increase Intensity of SCNLights

Hello I have a SCNScene that is the basis of my game. The lighting was tricky and to get the effect I wanted I ended up duplicating three lights three times. This increased the intensity of the lights to create the affect and colors I wanted.…
T Neate
  • 403
  • 2
  • 6
  • 18
2
votes
2 answers

Tube Physics Body acting like SCNCylinder, but how to make it act like SCNTube?

I am trying to make a tube and its physics body like so in SceneKit. let BoxGeometry = SCNTube(innerRadius: 5, outerRadius: 12.5, height: 4) Box = SCNNode(geometry: BoxGeometry) Box.pivot = SCNMatrix4MakeRotation(Float(M_PI_2/8), 0, 1,…
T Neate
  • 403
  • 2
  • 6
  • 18
2
votes
2 answers

Get radius of a SCNSphere that is used to create a SCNNode

How do i return the radius of a sphere geometry(SCNSphere) used to set up a SCNNode. I want to use the radius in a method where i move some child nodes in relation to a parent node. The code below fails since radius appears to be unknown to the…
David Karlsson
  • 9,396
  • 9
  • 58
  • 103
1
vote
0 answers

How to determine size of SCNPlane to cover entire SKScene

I am developing an iOS application for a "green screen" using ARKit. That is display an image as a background in a ARFaceTrackingConfiguration AR session (similar to the "green screen" functionality available in other apps such as zoom). I want the…
DCDC
  • 486
  • 5
  • 9
1
vote
2 answers

How to move SCNNode within a SCNView using UITapGestureRecognizer?

I created a SCNView and want to use a UITapGestureRecognizer to move SCNNode's around the view; however, the code I implemented doesn't seem to be working. The nodes move sometimes, but they never move to the correct spot. Does anyone know what I am…
helloworld12345
  • 176
  • 1
  • 4
  • 22
1
vote
1 answer

How to create a SCNNode with a custom geometry?

I am trying to create a SCNNode whose geometry is created using an array of x, y, and z positions. I am using the following code; however, this is not showing up. Does anyone know what's wrong? class CustomShapeNode: SCNNode { init(positions:…
helloworld12345
  • 176
  • 1
  • 4
  • 22
1
vote
1 answer

Converting SCNMatrix4 from swift to Objective-c

I can not for the life of me figure out how to create a SCNMatrix4 from a transform in objective-c. The swift code I'm trying to use in objective-c: let affineTransform = frame.displayTransform(for: .portrait, viewportSize:…
IamRob
  • 35
  • 6
1
vote
1 answer

In scene kit, adding a physics body manually (in code) to a node, seems to not work? You have to add the physics body in the editor?

It seems you just can't add a physics body in code. Not much more can be said than this, has anyone found this issue? Some example code ... class SomeSceneView: SCNView { public var box: SCNNode! .. var physBody =…
Fattie
  • 27,874
  • 70
  • 431
  • 719
1
vote
0 answers

Why hit test stops working when camera.zFar is set in Scenekit?

I have positive hit test results with following tapped function but when I set camera's "zFar" (to enable farther nodes to be displayed), hit test (performed on the node that previously worked and is in direct view to camera) stops working.. can…
Set
  • 21
  • 2
1
vote
0 answers

In tvOS how to actually put an SCNNode in a focus container? Scene nodes now have focus behavior, but how to include in the focus container?

You have a scene kit scene in your tvOS app. As usual the scene kit is part of a normal view controllert. Nowdays you can in fact do this: someNode.focusBehavior = .focusable reference -…
Fattie
  • 27,874
  • 70
  • 431
  • 719
1
vote
0 answers

Swift - SceneKit - How to properly orient Camera and Light Node with SCNCylinder (that's a 3D rendering of coordinate path)

I'm trying to recreate a feature like this: Where I take coordinates and elevation points of a hiking path and create a SceneKit rendering and animation. The orange ball animates along the white path while the entire object slowly rotates on the X…
escullz
  • 103
  • 1
  • 10
1
vote
2 answers

How to change the color of text just on one (front) side SCNText?

I am working with SCNScene where I place the SCNText node, so as a result, I get 3d text on the scene, the problem is that if I change the depth of the text it looks like a block of solid color, so it is hard to see what exactly on the screen, there…
Sirop4ik
  • 4,543
  • 2
  • 54
  • 121