由用户创建的信息 JohnDun
28 February 2018 19:24
Ah right I see, that's really interesting.
I got it to work using the React lifecycle hooks in one component, but there is an unusual bug which causes the app to restart the first couple times I run the WebGL component.
Having read your second comment though I'm almost sure that's what happens with mine.
Will have to give this a try - here is a look at how I got it to work.
https://github.com/JohnDun89/MyDeveloperReactSite/blob/master/client/src/containers/webGl.js
I got it to work using the React lifecycle hooks in one component, but there is an unusual bug which causes the app to restart the first couple times I run the WebGL component.
Having read your second comment though I'm almost sure that's what happens with mine.
Will have to give this a try - here is a look at how I got it to work.
https://github.com/JohnDun89/MyDeveloperReactSite/blob/master/client/src/containers/webGl.js
19 February 2018 18:36
Thanks for the reply.
I have been following this tutorial and got a scene working https://www.blend4web.com/en/community/article/408/.
After that, I built an app using React and a node js backend. The code I am using is pretty similar, but when it comes to calling load ( this.load in react) I always get a cannot read property undefined.
I'm thinking it could be something to do with passing a bad path across.
The link you provided gives me an access denied 403
I have been following this tutorial and got a scene working https://www.blend4web.com/en/community/article/408/.
After that, I built an app using React and a node js backend. The code I am using is pretty similar, but when it comes to calling load ( this.load in react) I always get a cannot read property undefined.
I'm thinking it could be something to do with passing a bad path across.
init_cb(canvas_elem, success) {
if (!success) {
console.log("b4w init failure");
return;
}
m_preloader.create_preloader();
// ignore right-click on the canvas element
canvas_elem.oncontextmenu = function (e) {
e.preventDefault();
e.stopPropagation();
return false;
};
//here is the error
this.load();
}
load() {
m_data.load(APP_ASSETS_PATH + "dinburgh.json", this.load_cb, this.preloader_cb);
}
preloader_cb(percentage) {
m_preloader.update_preloader(percentage);
}
load_cb(data_id, success) {
The link you provided gives me an access denied 403
18 February 2018 15:53