【发布时间】:2017-05-17 12:28:41
【问题描述】:
我在我的移动 App 中显示 3D(.obj 和 .stl)对象。
为了显示 3D 对象,我正在使用 SceneKit Framework.
-(void)spriteKitEx
{
sceneView = [[SCNView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height - 200)];
sceneView.playing = true ;
sceneView.allowsCameraControl = true ;
scene = [SCNScene sceneNamed:@"realship.obj"];
//Try to change color here using Scenlight
SCNLight *light =[[SCNLight alloc] init];
light.type = SCNLightTypeAmbient;
light.color = [UIColor redColor];
SCNNode *lightNode = [[SCNNode alloc] init];
lightNode.light = light ;
lightNode.scale = SCNVector3Make(1.0, 500.0, 2.0);
[scene.rootNode addChildNode:lightNode];
sceneView.scene = scene;
[sceneView setBackgroundColor: [UIColor redColor]];
[self.view addSubview:sceneView];
}
现在我的要求是根据用户手势改变 3D 对象的宽度和高度。
我尝试在我的 SceneView 对象中执行此操作,但无法更改宽度和高度。
【问题讨论】: