0

I am creating cube in scene kit. this is output.

enter image description here

You can see images are not size to fit in SceneView.

Here is my code :

SCNScene *scene = [[SCNScene alloc]init];

float X = 0.0;
float Radius = 1.0;

for (int i = 0; i<3; i++) {

    SCNBox *Box = [SCNBox boxWithWidth:3.0 height:3.0 length:3.0 chamferRadius:Radius];       
    self.cubeNode = [SCNNode nodeWithGeometry:Box];
    [ArrBoxNode addObject:self.cubeNode];
    self.sceneView.backgroundColor = [UIColor grayColor];
    self.view.backgroundColor  = [UIColor grayColor];
    self.cubeNode.position = SCNVector3Make(X,.00,0.0);
    [scene.rootNode addChildNode:self.cubeNode];
    self.sceneView.scene = scene;
    [self.sceneView sizeToFit];
    self.sceneView.contentScaleFactor = 0.0;
}

Can you please help me?i am stuck in this issue.

Fabio Berger
  • 1,921
  • 2
  • 24
  • 29
  • From the screenshot it looks like the scene view does not extend all the way to the edges. You should be able to confirm this by giving it a different background color from the view behind it (currently both are gray). How are you constraining the scene view? – David Rönnqvist Nov 23 '17 at 07:55
  • It's just the matter of changing the z position of the object. – El Tomato Nov 23 '17 at 08:51
  • @DavidRönnqvist thanks for reply.i set senekit color to red.i can see size of scenekit.but what is solution –  Nov 23 '17 at 09:15
  • @ElTomato change z position of camera ? –  Nov 23 '17 at 09:42
  • That depends on how you layout/constrain the view. Please include all the code/IB informations that relevant for constraining the scene view. – David Rönnqvist Nov 23 '17 at 09:42
  • @DavidRönnqvist this is my final code and i take SCNView –  Nov 23 '17 at 09:54

0 Answers0