ios - Unable to set initial radius of one SCNSphere -


i able add twenty small spheres of, say, radius 0.5 scene.

however, when attempt add one sphere, no matter radius specify, sphere appears default radius of 1.0.

here code i'm using add 1 sphere. merely put code inside loop add twenty spheres -- works fine.

func drawspheres() {     var x:float = 0.0     var radius:cgfloat = 0.5     let spheregeometry = scnsphere(radius: radius)     let spherenode = scnnode(geometry: spheregeometry)     spherenode.position = scnvector3(x: x, y: 0.0, z: 0.0)     self.rootnode.addchildnode(spherenode) } 

am missing obvious?

the problem seeing scene kit trying smart. working expected.

to able render scene, scene kit needs camera point of view. if scene contains camera, automatically made point of view. if scene doesn't have camera in it, scene kit has create own (or fail render together, less preferable). when scene kit creates own "default" point of view, tries adapt content of scene fills view best possible (a slight simplification).

this can nice little convenience, in case means when make sphere larger, scene kit adapts point of view sphere still covers entire view. if there 1 sphere in scene, means can't see difference in radius of sphere because cover entire view.

if add own camera scene , configure liking, able see difference when changing radius of sphere.


Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -