我正在与SceneKit
. 对象SCNNode
相对于中心旋转。如何改变锚点SCNNode
?
SCNScene *scene = [SCNScene new];
SCNBox *boxGeometry = [SCNBox boxWithWidth:384.f height:512.f length:20.f chamferRadius:0];
SCNMaterial *material = [SCNMaterial new];
material.diffuse.contents = [UIImage imageNamed:@"material"];
SCNNode *boxNode = [SCNNode nodeWithGeometry:boxGeometry];
boxNode.geometry.firstMaterial = material;
boxNode.pivot = SCNMatrix4MakeTranslation(0.5f, 0.5f, 0.5f);
[scene.rootNode addChildNode:boxNode];
self.sceneView.scene = scene;
self.sceneView.allowsCameraControl = YES;