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
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
  • 12,745
  • 9
  • 57
  • 95
7
votes
2 answers

How to detect touch and show new SCNPlane using ARKit?

Now I am able to show different SCNPlane, when card detected. After displaying SCNPlanes, the user touches any plane to show new SCNPlane. But right now touch is working properly but new SCNPlane is not showing. Here is the code I've tried: var…
PvDev
  • 791
  • 21
  • 67
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
  • 485
  • 9
  • 18
7
votes
0 answers

SceneKit: How to place a 3D object in order to fit the SCNView bounds?

I'm new to SceneKit and 3D objects. I've been doing some research but I didn't find an answer to my question. I need to display several 3D objects in an horizontal UICollectionView, one in each cell. I'd like them to be aligned and the same size so…
Marie Dm
  • 2,637
  • 3
  • 24
  • 43
7
votes
1 answer

SCNGeometry with polygon as primitiveType

Trying to figure out how I create a SCNGeometry with polygon as primitiveType, My goal is to add polygon shaped node as a child of a sphere node, and make it look like MKPolygon for map kit, like in this example. My current code is: //Take an…
ItayAmza
  • 819
  • 9
  • 21
6
votes
1 answer

How to draw dashed line in ARKit (SceneKit) like in the Measure app?

Just wanted to know is it possible (I know it is, but how) to draw dashed line in ARSCNView like in the Measure app? Maybe there is a way to use scene nodes out of the box, idk. I've been using the SCNCylinder to draw a straight line and IDK is it…
atereshkov
  • 4,311
  • 1
  • 38
  • 49
6
votes
1 answer

iOS: How to simulate default camera controls in SceneKit?

The code below is meant to simulate the default camera controls in SceneKit, specifically the zoom and rotate functionality. However, the code isn't nearly as smooth and versatile as the default controls. For instance, if you load these two models,…
Crashalot
  • 33,605
  • 61
  • 269
  • 439
6
votes
1 answer

SceneKit: adding directional light to camera node has no effect

Based on the advice in this answer, the goal is to add an ambient light to a scene along with a directional light to the camera. This works in the Xcode Scene Editor, with the directional light set at 70% white and the ambient light at 50% white.…
Crashalot
  • 33,605
  • 61
  • 269
  • 439
6
votes
2 answers

Is it possible to have a SCNNode which is transparent, but which occludes any object behind it?

So to be clear on my goals, since I don't have any code to share... Lets say I have a SCNNode which is positioned between the camera and another SCNNode. The first SCNNode is a SCNBox, but has no texture, thus the second SCNNode can be seen behind…
Andrew
  • 7,693
  • 11
  • 43
  • 81
6
votes
3 answers

Check if SCNNode SCNAction is finished

I have created a SceneKit 3D maze world in which a player can move. Some of the moves like jumping involve moving the camera up and down while changing to view direction over a period of time of several seconds. During this time I would like to…
Greg Robertson
  • 2,317
  • 1
  • 16
  • 30
6
votes
1 answer

Change SCNNode position without changing orientation

I am using SceneKit and have an app with multiple SCNNodes and when the user taps one, it will follow their finger (using a UILongPressGestureRecognizer). In the state began and changed, I am using the following line of code to change the node's…
Jsdodgers
  • 5,253
  • 2
  • 20
  • 36
5
votes
2 answers

Why is SCNNode.presentation.position so relatively slow, and is there a workaround?

I traced a major performance bottleneck in my SceneKit app to a nested loop being run a few thousand times. In that loop is a bunch of code that zooms along quite happily, apart from this one line: var scenePos = presentation.position It's over 100…
DenverCoder9
  • 3,635
  • 3
  • 31
  • 57
5
votes
1 answer

How to change SCNPlane color as clear color

I am working on a ARKit project which needs Ripple animation effect when tapped on Horizontal Plane. For that I have took UIView object and pass that as contents for material of SCNPlane object. I have added Ripple animation to UIView object.…
Hari
  • 144
  • 9
5
votes
4 answers

How to detect which SCNNode has been touched ARKit

I'm having some troubles with SCNode hit detection. I need to detect which object was touched in the scene having a SCNNode, I have implemented this piece of code but it seems crashing when I'm touching the object but working good when I'm touching…
Pietro Messineo
  • 777
  • 8
  • 28
1
2
3
26 27