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
5
votes
1 answer

Placing, Dragging and Removing SCNNodes in ARKit

I'm working on a small project using ARKit. I want to be able to add objects to my AR SceneView on tap, remove them with a double tap, and drag theme around with a pan or drag. The initial tap to place objects is working fine, but I have some…
Alan
  • 1,132
  • 7
  • 15
5
votes
2 answers

SceneKit. How to rotate SCNNode around its axis

I'm trying to achieve same rotation as in scene editor but with code so object always rotate around selected axis, however if I look at angles(x,y,z) in editor they changes quite randomly ![Local node axis][1] I've tried to use quaternions, but…
5
votes
2 answers

SceneKit get current SCNNode position form Animated SCNNode

I want to get a current node position form an animated SCNNode I am aware of presentationNode and I tried to extract position form there, but no Luck Here is my Code SCNNode * pelvis = [_unit childNodeWithName:@"Bip01_Pelvis"…
Coldsteel48
  • 3,482
  • 4
  • 26
  • 43
5
votes
0 answers

Changing the pivot doesn't change the coordinate system origin

I'm pretty new to SceneKit and I've stumbled upon a pretty odd, in my opinion, behaviour. Changing a node pivot move the point by which it's anchored to its parent as the pivot is placed at the point specified by the position of the node itself.…
Marco Boschi
  • 2,321
  • 1
  • 16
  • 30
5
votes
3 answers

Why SCNPhysicsBody resets position when set eulerAngles?

I'm trying to use SceneKit to develop a game for tvOS, and I'm having an issue. When I set the node's eulerAngle before apply an impulse to the physicsBody the node is reset to his original position. I was expecting to see the nodes moving around on…
casensio
  • 93
  • 8
5
votes
1 answer

removing SCNNode does not free memory before creating new SCNNode

I am building an app that uses Scenekit to display a scene based on information returned from a data base. I have created a custom class with a class func that creates a SCNNode containing everything that needs to be drawn and returns it to my…
PaulB
  • 111
  • 2
  • 13
5
votes
3 answers

Adding background image to ScnScene

I have an app which uses SpriteKit and emitter particles (sks) which I find to be not as realistic as Scene kit's particles (scnp). So I wish to incorporate that into SKScene but I'm not sure if that is even possible. So I decided to create an…
snksnk
  • 1,566
  • 4
  • 21
  • 46
4
votes
1 answer

Placing an object in front of camera at Touch Location

The following code places the node in front of the camera but always at the center 10cm away from the camera position. I want to place the node 10cm away in z-direction but at the x and y co-ordinates of where I touch the screen. So touching on…
Zeus Eternal
  • 427
  • 1
  • 4
  • 11
4
votes
3 answers

Why is SCNNode "jiggling" when dropped onto SCNPlane?

I have a SCNPlane that is added to the scene when a sufficient area is detected for a horizontal surface. The plane appears to be placed in a correct spot, according to the floor/table it's being placed on. The problem is when I drop a SCNNode(this…
Jake Dobson
  • 1,716
  • 3
  • 11
  • 29
4
votes
2 answers

Rotate SCNNode relative local coordinates

I'm trying to rotate a node by SCNAction, but it rotates relative to parent’s coordinate space. Is it possible to rotate a node relative local's coordinate system?
Nikita Ermolenko
  • 2,139
  • 2
  • 19
  • 41
4
votes
0 answers

SceneKit: orbit camera around point with one gesture while allowing camera to rotate with different gesture

Assume a SceneKit scene offers a perspective similar to Minecraft. There is one camera. The camera node acts like the "head" of a person while its parent node acts like the "body." The camera node is a child of the parent node, called…
Crashalot
  • 33,605
  • 61
  • 269
  • 439
4
votes
2 answers

SceneKit: Associating Nodes with Model Objects

I need to associate SceneKit Node objects with arbitrary objects in my program and am looking for an optimal solution. Here is an example of what I mean: Say I have a program that renders atoms in a molecule using SceneKit. I have classes Molecule…
Matt H
  • 155
  • 4
4
votes
2 answers

Converting a nested SCNNode position to a CGPoint in screen space

I'm trying to convert the 3d position of a nested SCNNode in to an x, y (CGPoint) coordinate (for overlaying a view over the object). My SCNNode structure looks like: +-----------+ | Root node | +-----+-----+ | …
jxd
  • 43
  • 5
4
votes
2 answers

SceneKit Camera Animation Moving and Deceleration

I'm moving the camera node of my SCNScene scene along the z-axis using the following code: let moveTo = SCNAction.moveTo(SCNVector3(x:0,y:0,z:-40), duration: 40); cameraNode.runAction(moveTo) I would like given an event (like GameOver event fired…
chiarotto.alessandro
  • 1,491
  • 1
  • 13
  • 31
4
votes
2 answers

SceneKit draw curved line

I'd like to draw a bezier curved line with SceneKit and thought this would work: func drawCurvedLine() { let scene = SCNScene() let scnView = self.view as! SCNView scnView.scene = scene scnView.allowsCameraControl = true let…
dijipiji
  • 3,063
  • 1
  • 26
  • 21
1 2
3
26 27