我使用了3D iphone(.pod)模型,它在PVRShammon中正确显示.
但是当我将这个3D模型导入到isgl3D中时,它没有正确显示纹理图像,图像只覆盖了一些具有一些线条和三角形的对象区域.
_cameraController = [[Isgl3dDemoCameraController alloc] initWithCamera:self.camera andView:self];
_cameraController.orbit = 10;
_cameraController.theta = 20;
_cameraController.phi = 0;
_cameraController.doubleTapEnabled = NO;
Isgl3dPODImporter * podImporter = [Isgl3dPODImporter podImporterWithFile:@"iPhone5Spod.pod"];
[podImporter printPODInfo];
[podImporter buildSceneObjects];
Isgl3dTextureMaterial *material2 = [[[Isgl3dTextureMaterial alloc]
initWithTextureFile:@"DiffuseBody2.jpg"
shininess:0.0
precision:Isgl3dTexturePrecisionHigh
repeatX:YES
repeatY:YES] autorelease];
mesh2 = [podImporter meshAtIndex:4];
node2 = [self.scene createNodeWithMesh: mesh2 andMaterial:material2];
mesh2.normalizationEnabled = YES;
node2.position = iv3(0, 0, 0);
node2.rotationY = 180;
[podImporter addMeshesToScene:self.scene];
Isgl3dLight * light = [Isgl3dLight lightWithHexColor:@"FFFFFF" diffuseColor:@"FFFFFF" specularColor:@"FFFFFF" attenuation:0.000];
light.lightType = DirectionalLight;
[light setDirection:-1 y:-1 …Run Code Online (Sandbox Code Playgroud) 我在我的项目中使用了AFNetworking,每当我发送请求时,我都会在失败块中收到此消息,
Error Domain = com.alamofire.error.serialization.response Code = -1011"请求失败:未授权(401)"UserInfo = {com.alamofire.serialization.response.error.response = com.alamofire.serialization.response.error. data = <7b227375 63636573 73223a66 616c7365 2c226d65 73736167 65223a22 41757468 656e7469 63617469 6f6e2066 61696c65 64227d>,NSLocalizedDescription =请求失败:未授权(401)}
这就是我使用AFNetworking发送请求的方式.
AFHTTPSessionManager *manager = [[AFHTTPSessionManager alloc] initWithBaseURL:[NSURL URLWithString:BASE_URL]];
manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", nil];
NSString *path = [NSString stringWithFormat:@"/api/##/##/##/sign_in"];
NSString *params = @"{\"user\": {\"uid\": \"10236412002551\",\"access_token\":\"g6tdbvc34seadcx7yufbbcgvf8ijhss\",\"email\": \"user@domain1.com\",\"latitude\": \"6.927079\", \"longitude\": \"79.861243\",\"remote_avatar_url\": \"\"}}";
manager.requestSerializer = [AFJSONRequestSerializer serializer];
manager.responseSerializer = [AFJSONResponseSerializer serializer];
AFSecurityPolicy* policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeCertificate];
[policy setValidatesDomainName:NO];
[policy setAllowInvalidCertificates:YES];
[manager POST:path parameters:params success:^(NSURLSessionDataTask *task, id …Run Code Online (Sandbox Code Playgroud)