Prechádzať zdrojové kódy

FBXLoader: Increase sampling for nurbs geometries. (#22202)

Michael Herzog 4 rokov pred
rodič
commit
45df8623fd
1 zmenil súbory, kde vykonal 3 pridanie a 14 odobranie
  1. 3 14
      examples/jsm/loaders/FBXLoader.js

+ 3 - 14
examples/jsm/loaders/FBXLoader.js

@@ -639,7 +639,7 @@ class FBXTreeParser {
 
 					}
 					break;
-					
+
 				case 'NormalMap':
 				case 'Maya|TEX_normal_map':
 					parameters.normalMap = scope.getTexture( textureMap, child.ID );
@@ -2295,20 +2295,9 @@ class GeometryParser {
 		}
 
 		const curve = new NURBSCurve( degree, knots, controlPoints, startKnot, endKnot );
-		const vertices = curve.getPoints( controlPoints.length * 7 );
-
-		const positions = new Float32Array( vertices.length * 3 );
-
-		vertices.forEach( function ( vertex, i ) {
-
-			vertex.toArray( positions, i * 3 );
-
-		} );
-
-		const geometry = new BufferGeometry();
-		geometry.setAttribute( 'position', new BufferAttribute( positions, 3 ) );
+		const points = curve.getPoints( controlPoints.length * 12 );
 
-		return geometry;
+		return new BufferGeometry().setFromPoints( points );
 
 	}