2017-08-15 227 views
0

我从故宫安装三个包,并试图打电话three.js所:进口THREE.Lut()

lut = new THREE.Lut(colorMap, numberOfColors); 

我越来越"export 'Lut' (imported as 'THREE') was not found in 'three'

Lut.js文件可以在\node_modules\three\examples\js\math找到,但它不包含export声明和需要three.js本身。

我试过import 'three/examples/js/math/Lut';和其他约定,但都没有工作。

回答

0

你试过

import Lut from 'three/examples/js/math/Lut' 

然后

let lut = new Lut(...); 

想必你也可以做到这一点,而不是

import THREE from 'three' 
let lut = new THREE.Lut(...); 

编辑

它看起来不像three.js允许您在此时导入示例,但有很多建议/解决方法可供您在此问题中查看,但看起来不会立即实施:

https://github.com/mrdoob/three.js/issues/9562

+0

'从“three''进口三是不工作,并且第一建议也将失败。它看起来像'Lut.js'从里面调用'THREE'对象。 – galah92

+0

@ galah92看起来不像three.js允许你在这个时候导入示例,这里有很多你可以看看的建议/解决方法:https://github.com/mrdoob/three.js/issues/9562,但它看起来不会很快实施。 – Purgatory