如何在SceneKit中缩小对象?

时间:2017-11-23 07:41:47

标签: ios objective-c scenekit scnnode

我在场景工具包中创建立方体。这是输出。

enter image description here

您可以看到图像的大小不适合SceneView。

这是我的代码:

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;
}

你能帮助我吗?我陷入了这个问题。

0 个答案:

没有答案