admin管理员组

文章数量:1386813

In my project, I have several nodes (SCNNode) with some levels of detail (SCNLevelOfDetail) and everything works correctly, but when I add animation using morphing (SCNMorpher), the animation works correctly but without the levels of detail. Note: the entire scene is created in Autodesk 3D Studio Max and then exported in (.ASE) format.

The goal is to make animations using morphing that have some levels of detail.

Does anyone know if SCNMorpher supports geometry with some levels of detail?

I appreciate any information about this case.

Thanks everyone!!!

Part of the code I use to load geometries (SCNGeometry) with some levels of detail (SCNLevelOfDetail) using morphing (SCNMorpher).

node.morpher = [SCNMorpher new];

SCNGeometry *geometry = [self geometryWithMesh:mesh];
NSMutableArray <SCNLevelOfDetail*> *mutLevelOfDetail = [NSMutableArray arrayWithCapacity:self.mutLevelsOfDetail.count];

for (int i = 0; i < self.mutLevelsOfDetail.count; i++) {
    ASCGeomObject *geomObject = self.mutLevelsOfDetail[i];
    SCNGeometry *geometry = [self geometryWithMesh:geomObject.mesh.mutMeshAnimation[i]];
    
    [mutLevelOfDetail addObject:[SCNLevelOfDetail levelOfDetailWithGeometry:geometry worldSpaceDistance:geomObject.worldSpaceDistance]];
}

geometry.levelsOfDetail = mutLevelOfDetail;
node.morpher.targets = [node.morpher.targets arrayByAddingObject:geometry];

In my project, I have several nodes (SCNNode) with some levels of detail (SCNLevelOfDetail) and everything works correctly, but when I add animation using morphing (SCNMorpher), the animation works correctly but without the levels of detail. Note: the entire scene is created in Autodesk 3D Studio Max and then exported in (.ASE) format.

The goal is to make animations using morphing that have some levels of detail.

Does anyone know if SCNMorpher supports geometry with some levels of detail?

I appreciate any information about this case.

Thanks everyone!!!

Part of the code I use to load geometries (SCNGeometry) with some levels of detail (SCNLevelOfDetail) using morphing (SCNMorpher).

node.morpher = [SCNMorpher new];

SCNGeometry *geometry = [self geometryWithMesh:mesh];
NSMutableArray <SCNLevelOfDetail*> *mutLevelOfDetail = [NSMutableArray arrayWithCapacity:self.mutLevelsOfDetail.count];

for (int i = 0; i < self.mutLevelsOfDetail.count; i++) {
    ASCGeomObject *geomObject = self.mutLevelsOfDetail[i];
    SCNGeometry *geometry = [self geometryWithMesh:geomObject.mesh.mutMeshAnimation[i]];
    
    [mutLevelOfDetail addObject:[SCNLevelOfDetail levelOfDetailWithGeometry:geometry worldSpaceDistance:geomObject.worldSpaceDistance]];
}

geometry.levelsOfDetail = mutLevelOfDetail;
node.morpher.targets = [node.morpher.targets arrayByAddingObject:geometry];
Share Improve this question asked Mar 18 at 6:59 Carlos EduardoCarlos Eduardo 1 0
Add a comment  | 

1 Answer 1

Reset to default 0

Regarding this issue, I checked with Apple engineers and Scenekit does not support this feature.

I added a suggestion for improvement and as soon as I have some feedback I will post it here.

Here is the link to the request.

https://developer.apple/forums/thread/776935?page=1#832672022

本文标签: SceneKit SCNMorpher Supports SCNGeometry with Some SCNLevelOfDetailStack Overflow