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

How do I rotate a SCNNode to look at another node, whilst keeping its roll and pitch level with the camera?

I am using ARKit to direct people to a position in the physical world using an arrow attached to the camera node. Applying a lookAtConstraint to the arrow with a target of a node in the location I want almost does what I need. However, I need to…
Jacob
  • 35
  • 5
2
votes
1 answer

Get Size of image in SCNNode / ARKit Swift

I'm trying to scan a Reference-Image an then display the image itself above the printed reference-image. The "virutal" image size should be the same like the printed size. My idea: get the size of the printed Reference-Image, then scale the image in…
P Star
  • 67
  • 2
  • 13
2
votes
1 answer

How to rotate/scale/change coordinates of SCNNode programatically in ios

I want to put 3D Spectacles model in human's eye using face/eye detection and it should be movable as face moves like Snapchat does. I have loaded the 3D .obj model in view but I can not able to change the rotation angle, coordinates and zoom value…
Viral Mithani
  • 313
  • 4
  • 17
2
votes
0 answers

Play animation from a specific keyframes in SCNNode

I have imported a 3D dinosaur in my app. It has some animations, first, it is idle for 8 seconds and then roars. I need to repeat this 8 seconds for a while and then continue the rest of animation, and repeat this process. Is there any possible way…
iOS.Lover
  • 5,923
  • 21
  • 90
  • 162
2
votes
0 answers

ARKit - Rotating a moving SCNNode to face the camera

I am using this function to animate a rotation of a SCNNode: let rotateNode = SCNAction.rotateTo(x: 0.0, y: CGFloat((headingAngle )), z: 0.0, duration: TimeInterval(1.1), usesShortestUnitArc: true) node.runAction(rotateNode) It works…
Tim Friedland
  • 1,045
  • 11
  • 18
2
votes
0 answers

Scenekit: How to check in which direction a node is facing toward camera

I am creating a 3D modeling module in my app. I am rotating the Node with following code: -(void)handlePan:(UIPanGestureRecognizer *)gesture{ NSString *nodeName = nil; for (SCNNode *node in _sceneView.scene.rootNode.childNodes) { if(node.name…
Hassy
  • 5,068
  • 5
  • 38
  • 63
2
votes
0 answers

ARKit : SCNBox moves with camera

I am drawing huge box of length 20 meters width 0.5 meters and height 0.5 meters which is 2 meters away from the origin. Box rendered properly without any issues. However box look smaller and seems to be spread across less length compared to actual…
Venkatesh
  • 3,558
  • 8
  • 32
  • 38
2
votes
1 answer

Update SCNPhysicsBody when scaling SCNNode

I know that SCNPhysicsBody dont scale when the node scale, but I haven't found a great solution to fix this. I want to scale the node and then update the SCNPhysicsBody to node after scaling it. let box = SCNBox(width: 0.2, height: 0.3, length:…
Magnus T
  • 220
  • 1
  • 9
2
votes
3 answers

Animating SCNConstraint (LookAt) for SCNNode in SceneKit game to make the transition gradual

In general, when one wants to make a character in a game face the camera, one can use SCNLookAtConstraint, which actually is serving me well too. Below, my_object is the node which I am trying to orient as per constraint. 'Enemy' refers to some…
Manganese
  • 650
  • 5
  • 26
2
votes
1 answer

How to use ScnNode as a ScnLight?

var sun = SCNNode(geometry: SCNSphere(radius:0.35)) sun.geometry?.firstMaterial?.diffuse.contents=#imageLiteral(resourceName: "Sun") sun.position=SCNVector3(0,0,-1) And i want to use the sun SCNSphere as a omni light source. let OmniLight =…
DAWID
  • 79
  • 6
2
votes
0 answers

Gradually decrease animation speed on a SCNNode? [IOS]

As I swipe on the screen I want a SCNNode object to rotate while the speed is decreasing. When the speed is 0 the animation should stop. Here is my code: ViewDidLoad: sceneView.delegate = self let scene = SCNScene(named:…
Magnus T
  • 220
  • 1
  • 9
2
votes
1 answer

Why does SCNNode move all over the place using ARKit?

I have 2 SCNNode's in my view and when I shake my phone's camera, the node's go crazy and start moving to weird places by themselves. Does anyone know how to fix that and make them stay in one place? Thanks!
Amit Kalra
  • 4,085
  • 6
  • 28
  • 44
2
votes
2 answers

How to make SCNNode rotate/spin horizontally

I'm trying to make my SCNNode automatically rotate horizontally by itself. This is the code I have so far: box.scale = SCNVector3(x: 0.26, y: 0.26, z: 0.26) box.position = SCNVector3(0.15, 3.85, -3) How do I make this box spin horizontally…
Amit Kalra
  • 4,085
  • 6
  • 28
  • 44
2
votes
1 answer

SceneKit geometries look like a glitchy disaster

I'm messing around with SceneKit. I feel like I'm doing everything as instructed, but the animation I end up with looks like a glitchy mess. The geometries have this odd kind of shattered quality to them. Shapes that should be behind over shapes are…
Josh Knowles
  • 395
  • 4
  • 19
2
votes
1 answer

SceneKit: advice on reproducing glowing light trail like with Tron light cycles

The goal is to reproduce a light trail similar to the image below in SceneKit. The trail doesn't need to be as detailed, but the idea is to achieve a similar visual effect. We tried using thin cubes with opacity around 0.5. We strung about 200…
Crashalot
  • 33,605
  • 61
  • 269
  • 439