我旋轉3D模型與此代碼的觸摸事件對進口3D模型:關於在NinevehGL框架
_mesh = [[NGLMesh alloc] initWithFile:@"01.obj" settings:settings delegate:self];
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
[super touchesMoved:touches withEvent:event];
UITouch *touch;
CGPoint pointA,pointB;
if ([touches count]== 1) {
touch = [[touches allObjects]objectAtIndex:0];
pointA = [touch locationInView:self.view];
pointB = [touch previousLocationInView:self.view];
// _mesh.rotateY -= (pointA.x - pointB.x) * 0.5f;
// _mesh.rotateX -= (pointA.y - pointB.y) * 0.5f;
_mesh.rotateY += (pointA.x - pointB.x) * 0.5f;
_mesh.rotateX += (pointA.y - pointB.y) * 0.5f;
}
}
代碼旋轉像它應該,但它旋轉無論身在何處的觀點我點擊。我希望它只在接觸導入模型時旋轉。我將如何做到這一點?
謝謝你的回覆..是否有任何方法來獲得3d對象的框架?我沒有找到任何.. – Sandeep
我認爲在http://nineveh.gl/community/forum/上發佈您的問題會更好,他們會在一天內回覆 –