kalwalt / ARnft-ES6-react

A testing repository for ARnft in a React app.
https://kalwalt.github.io/ARnft-ES6-react/
6 stars 4 forks source link

Testing new ARnft and ARnft-threejs package #15

Closed kalwalt closed 3 years ago

kalwalt commented 3 years ago

Testing the new ARnft lib without the ThreejsRenderer class see PR https://github.com/webarkit/ARnft/pull/180 (now on dev branch) and the new ARnft-threejs package

kalwalt commented 3 years ago

I'm testing ARnft-threejs with this PR https://github.com/webarkit/ARnft-threejs/pull/6. Anyway i get this error:

three.module.js:24647 Uncaught TypeError: material.onBuild is not a function
    at getProgram (three.module.js:24647)
    at setProgram (three.module.js:24809)
    at WebGLRenderer.renderBufferDirect (three.module.js:24010)
    at renderObject (three.module.js:24588)
    at renderObjects (three.module.js:24561)
    at WebGLRenderer.render (three.module.js:24340)
    at SceneRendererTJS.draw (SceneRendererTJS.ts:112)
    at tick (App.js:49)

Maybe because the Three.js code should be in the ComponentDidMount ?

kalwalt commented 3 years ago

Probably this error is caused by double import of Threejs https://discourse.threejs.org/t/uncaught-typeerror-material-onbuild-is-not-a-function/26071

kalwalt commented 3 years ago

That issue https://github.com/kalwalt/ARnft-ES6-react/pull/15#issuecomment-847134120 was caused by a non matching version of Three.js, i was using0.126.1 but instead was required 0.128.0