iOS使用assimpKit加载FBX模型步骤详解

研究背景
体积:一个.dae模型大概有1M那么大  而.fbx模型0.5M
xcode现在不能直接读取.fbx模型
1.使用assimpKit加载
2.使用Wish3D加载
1.使用assimpKit--可行
2.使用Wish3D-- 官方文档有问题,然后咨询还不回复----直接丢弃
1.读取模型的  顶点坐标  纹理坐标  法线  骨骼顶点  骨骼动画 
2.调用以下方法画出模型 
根据顶点坐标和模型类型画出模型,模型类型可以是点、线、三角形
为什么是三角形呢?因为三角形是最小边几何图形
+ (instancetype)geometrySourceWithVertices:(const SCNVector3 *)vertices count:(NSInteger)count;
3.调用以下方法设置纹理
+ (instancetype)geometrySourceWithNormals:(const SCNVector3 *)normals count:(NSInteger)count;
用以下方法设置模型图片 就是设置node的纹理
SCNGeometry *geo = [SCNGeometry geometryWithSources:sources elements:elements];
UIImage * image  = [UIImage imageNamed:@"xy.jpg"];
SCNMaterial *mat = [SCNMaterial material];
mat.diffuse.contents = image;
geo.firstMaterial = mat;
geo.firstMaterial.doubleSided = YES;
4.调用以下方法画出法线
+ (instancetype)geometrySourceWithTextureCoordinates:(const CGPoint *)texcoord count:(NSInteger)count;
5.调用以下方法画出骨骼顶点
+ (instancetype)geometrySourceWithData:(NSData *)data semantic:(SCNGeometrySourceSemantic)semantic vectorCount:(NSInteger)vectorCount floatComponents:(BOOL)floatComponents componentsPerVector:(NSInteger)componentsPerVector bytesPerComponent:(NSInteger)bytesPerComponent dataOffset:(NSInteger)offset dataStride:(NSInteger)stride;
6.调用以下方法设置与骨骼顶点向连接的部分
+ (instancetype)geometrySourceWithData:(NSData *)data semantic:(SCNGeometrySourceSemantic)semantic vectorCount:(NSInteger)vectorCount floatComponents:(BOOL)floatComponents componentsPerVector:(NSInteger)componentsPerVector bytesPerComponent:(NSInteger)bytesPerComponent dataOffset:(NSInteger)offset dataStride:(NSInteger)stride;
7.调用以下方法设置骨骼动画皮肤那方面的
+ (instancetype)geometrySourceWithData:(NSData *)data semantic:(SCNGeometrySourceSemantic)semantic vectorCount:(NSInteger)vectorCount floatComponents:(BOOL)floatComponents componentsPerVector:(NSInteger)componentsPerVector bytesPerComponent:(NSInteger)bytesPerComponent dataOffset:(NSInteger)offset dataStride:(NSInteger)stride
8.调用以下方法设置把骨骼相信存放到一个SCNSkinner类
+ (instancetype)skinnerWithBaseGeometry:(nullable SCNGeometry *)baseGeometry bones:(NSArray<SCNNode *> *)bones boneInverseBindTransforms:(nullable NSArray<NSValue *> *)boneInverseBindTransforms boneWeights:(SCNGeometrySource *)boneWeights boneIndices:(SCNGeometrySource *)boneIndices API_AVAILABLE(macos(10.10));
9.调用以下方法设置骨骼动画的值和类型
+ (SCNAction *)repeatActionForever:(SCNAction *)action;
10.调用以下方法运行骨骼动画
- (void)runAction:(SCNAction *)action API_AVAILABLE(macos(10.10));
把assimpKit接入项目

1.到 assimpKit 下载 文件
文件很大的 要找到ios的

2.把assimpKit.frame 拖入工程里

"_compress", referenced from:
“_uncompress", referenced from:
"_compress2", referenced from:
"_inflateReset", referenced from:
"inflateInit", referenced from:
"_inflateEnd", referenced from:
"inflateInit2", referenced from:

有两种解决方法