现在看,工具上不支持,真机正常
MapContext.fromScreenLocation(Object object)使用不生效?[图片] 代码片段 https://developers.weixin.qq.com/s/cheRhimg7QCc 这样使用没有问题吧。未打印相关参数,也没有报错
2023-02-22class GLTFDracoMeshCompressionExtension { constructor( json, dracoLoader ) { if ( ! dracoLoader ) { throw new Error( 'THREE.GLTFLoader: No DRACOLoader instance provided.' ); } this.name = EXTENSIONS.KHR_DRACO_MESH_COMPRESSION; this.json = json; this.dracoLoader = dracoLoader; this.dracoLoader.preload(); } decodePrimitive( primitive, parser ) { const json = this.json; const dracoLoader = this.dracoLoader; const bufferViewIndex = primitive.extensions[ this.name ].bufferView; const gltfAttributeMap = primitive.extensions[ this.name ].attributes; const threeAttributeMap = {}; const attributeNormalizedMap = {}; const attributeTypeMap = {}; for ( const attributeName in gltfAttributeMap ) { const threeAttributeName = ATTRIBUTES[ attributeName ] || attributeName.toLowerCase(); threeAttributeMap[ threeAttributeName ] = gltfAttributeMap[ attributeName ]; } for ( const attributeName in primitive.attributes ) { const threeAttributeName = ATTRIBUTES[ attributeName ] || attributeName.toLowerCase(); if ( gltfAttributeMap[ attributeName ] !== undefined ) { const accessorDef = json.accessors[ primitive.attributes[ attributeName ] ]; const componentType = WEBGL_COMPONENT_TYPES[ accessorDef.componentType ]; attributeTypeMap[ threeAttributeName ] = componentType; attributeNormalizedMap[ threeAttributeName ] = accessorDef.normalized === true; } } return parser.getDependency( 'bufferView', bufferViewIndex ).then( function ( bufferView ) { return new Promise( function ( resolve ) { dracoLoader.decodeDracoFile( bufferView, function ( geometry ) { for ( const attributeName in geometry.attributes ) { const attribute = geometry.attributes[ attributeName ]; const normalized = attributeNormalizedMap[ attributeName ]; if ( normalized !== undefined ) attribute.normalized = normalized; } resolve( geometry ); }, threeAttributeMap, attributeTypeMap ); } ); } ); } }
threejs-miniprogram加载glb文件是出现问题,如何解决?提示我没有加载DRACOLoader,请问threejs-miniprogram要如何加载DRACOLoader? [图片]
2023-02-22