简体   繁体   中英

Changing SCNNode scale has no effect

I'm new to ARKit and SceneKit. I have a rather complex scene coming from an 3D artist. He replaced some items with SceneKit objects. I now try to change the properties of one of the SCNNodes, in this case the scale property, in another case the position in space, and in yet another I have a SCNText where I change the string property:

feedScaler?.scale = SCNVector3Make(1.0, scale, 1.0)

feedText?.string = String(feedValue)

feedIndicator?.position.y = someNewValue

So, pretty straight forward. When I run the scene though, it seems that the changes here are only commited once, before the scene appears. Then nothing happens. Here's the thing:

  • the method which updates the properties runs once per frame
  • I print out the property values of the nodes to the console and they update each frame
  • the text updates, too, and is the only update which is actually rendered and visible.

Note: There's also animations in that scene that do not play unless I uncheck "Use scene time base". Maybe that is a hint regarding how the Scene's animations are handled...

I found the issue. I used a clone of the scene which caused the references to get lost. The documentation says:

Cloning or copying a node creates a duplicate of the node object, but not the geometries, lights, cameras, and other SceneKit objects attached to it—instead, each copied node shares references to these objects.

When the original gets lost all the references get useless.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM