JamesLMilner / THREEAR

A marker based Augmented Reality library for Three.js
https://jameslmilner.github.io/THREEAR/
171 stars 24 forks source link

Error when using with React #106

Closed Epiczzor closed 4 years ago

Epiczzor commented 4 years ago

Hey So i am trying to make this work with my React and react-three-fiber project i followed the repo you mentioned on #76 as here

I get the following console logs

Allocated videoFrameSize 1228800
Pattern detection mode set to 1.
Pattern ratio size set to 0.500000.

And then I am getting the following error Uncaught TypeError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The provided value is not of type '(CSSImageValue or HTMLImageElement or SVGImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap or OffscreenCanvas)'

I'm not sure where im wrong

Epiczzor commented 4 years ago

I solved this issue, it is not an error with THREEAR

the setup in the repository was incorrect, i had to initialize threear outside the render function, ill put up a repository shortly with a boiler plate of integrating this with React

JamesLMilner commented 4 years ago

Glad you managed to get it sorted!