examples/FBXLoader.js
function ( geoNode ) {

			if ( THREE.NURBSCurve === undefined ) {

				console.error( 'THREE.FBXLoader: The loader relies on THREE.NURBSCurve for any nurbs present in the model. Nurbs will show up as empty geometry.' );
				return new THREE.BufferGeometry();

			}

			var order = parseInt( geoNode.Order );

			if ( isNaN( order ) ) {

				console.error( 'THREE.FBXLoader: Invalid Order %s given for geometry ID: %s', geoNode.Order, geoNode.id );
				return new THREE.BufferGeometry();

			}

			var degree = order - 1;

			var knots = geoNode.KnotVector.a;
			var controlPoints = [];
			var pointsValues = geoNode.Points.a;

			for ( var i = 0, l = pointsValues.length; i < l; i += 4 ) {

				controlPoints.push( new THREE.Vector4().fromArray( pointsValues, i ) );

			}

			var startKnot, endKnot;

			if ( geoNode.Form === 'Closed' ) {

				controlPoints.push( controlPoints[ 0 ] );

			} else if ( geoNode.Form === 'Periodic' ) {

				startKnot = degree;
				endKnot = knots.length - 1 - startKnot;

				for ( var i = 0; i < degree; ++ i ) {

					controlPoints.push( controlPoints[ i ] );

				}

			}

			var curve = new THREE.NURBSCurve( degree, knots, controlPoints, startKnot, endKnot );
			var vertices = curve.getPoints( controlPoints.length * 7 );

			var positions = new Float32Array( vertices.length * 3 );

			vertices.forEach( function ( vertex, i ) {

				vertex.toArray( positions, i * 3 );

			} );

			var geometry = new THREE.BufferGeometry();
			geometry.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) );

			return geometry;

		}
function ( geoNode ) {

			if ( THREE.NURBSCurve === undefined ) {

				console.error( 'THREE.FBXLoader: The loader relies on THREE.NURBSCurve for any nurbs present in the model. Nurbs will show up as empty geometry.' );
				return new THREE.BufferGeometry();

			}

			var order = parseInt( geoNode.Order );

			if ( isNaN( order ) ) {

				console.error( 'THREE.FBXLoader: Invalid Order %s given for geometry ID: %s', geoNode.Order, geoNode.id );
				return new THREE.BufferGeometry();

			}

			var degree = order - 1;

			var knots = geoNode.KnotVector.a;
			var controlPoints = [];
			var pointsValues = geoNode.Points.a;

			for ( var i = 0, l = pointsValues.length; i < l; i += 4 ) {

				controlPoints.push( new THREE.Vector4().fromArray( pointsValues, i ) );

			}

			var startKnot, endKnot;

			if ( geoNode.Form === 'Closed' ) {

				controlPoints.push( controlPoints[ 0 ] );

			} else if ( geoNode.Form === 'Periodic' ) {

				startKnot = degree;
				endKnot = knots.length - 1 - startKnot;

				for ( var i = 0; i < degree; ++ i ) {

					controlPoints.push( controlPoints[ i ] );

				}

			}

			var curve = new THREE.NURBSCurve( degree, knots, controlPoints, startKnot, endKnot );
			var vertices = curve.getPoints( controlPoints.length * 7 );

			var positions = new Float32Array( vertices.length * 3 );

			vertices.forEach( function ( vertex, i ) {

				vertex.toArray( positions, i * 3 );

			} );

			var geometry = new THREE.BufferGeometry();
			geometry.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) );

			return geometry;

		}
function ( geoNode ) { if ( THREE . NURBSCurve === undefined ) { console . error ( 'THREE.FBXLoader: The loader relies on THREE.NURBSCurve for any nurbs present in the model. Nurbs will show up as empty geometry.' ) ; return new THREE . BufferGeometry ( ) ; } var order = parseInt ( geoNode . Order ) ; if ( isNaN ( order ) ) { console . error ( 'THREE.FBXLoader: Invalid Order %s given for geometry ID: %s' , geoNode . Order , geoNode . id ) ; return new THREE . BufferGeometry ( ) ; } var degree = order - 1 ; var knots = geoNode . KnotVector . a ; var controlPoints = [ ] ; var pointsValues = geoNode . Points . a ; for ( var i = 0 , l = pointsValues . length ; i < l ; i += 4 ) { controlPoints . push ( new THREE . Vector4 ( ) . fromArray ( pointsValues , i ) ) ; } var startKnot , endKnot ; if ( geoNode . Form === 'Closed' ) { controlPoints . push ( controlPoints [ 0 ] ) ; } else if ( geoNode . Form === 'Periodic' ) { startKnot = degree ; endKnot = knots . length - 1 - startKnot ; for ( var i = 0 ; i < degree ; ++ i ) { controlPoints . push ( controlPoints [ i ] ) ; } } var curve = new THREE . NURBSCurve ( degree , knots , controlPoints , startKnot , endKnot ) ; var vertices = curve . getPoints ( controlPoints . length * 7 ) ; var positions = new Float32Array ( vertices . length * 3 ) ; vertices . forEach ( function ( vertex , i ) { vertex . toArray ( positions , i * 3 ) ; } ) ; var geometry = new THREE . BufferGeometry ( ) ; geometry . addAttribute ( 'position' , new THREE . BufferAttribute ( positions , 3 ) ) ; return geometry ; }
Generate a NurbGeometry from a node in FBXTree.Objects.Geometry
Generate a NurbGeometry from a node in FBXTree . Objects . Geometry