このチュートリアルhttp://www.icodeblog.com/2012/09/07/3856/に従って iPhone アプリを作成していますが、3d obj(earth) を私の obj ファイルに置き換えようとすると、うまくいきません。に追加された obj ファイルに特定の要件はありますnglview
か? これはviewdidload部分です:
NGLView *tmpView = [[NGLView alloc] initWithFrame:CGRectMake(110, 110, 140, 140)];
// Set its delegate to self so the drawview method is used.
tmpView.delegate = self;
// Add the new view on top of our existing view.
[self.view addSubview:tmpView];
tmpView.contentScaleFactor = [[UIScreen mainScreen] scale];
// Setup some initial environment states to be applied to our mesh.
NSDictionary *settings = [NSDictionary dictionaryWithObjectsAndKeys:
kNGLMeshOriginalYes, kNGLMeshKeyOriginal,
@"1", kNGLMeshKeyNormalize, nil];
// Initialize the mesh which includes the model file to import (.obj or .dae).
_mesh = [[NGLMesh alloc] initWithFile:@"PAN.obj" settings:settings delegate:nil];
// Initialize the camera used to render the scene.
_camera = [[NGLCamera alloc] initWithMeshes:_mesh, nil];
// If a trasparent background of the NGLView is needed
tmpView.backgroundColor = [UIColor clearColor];
nglGlobalColorFormat(NGLColorFormatRGBA);
nglGlobalFlush();