how to save dat.gui parameter to backend, i am using django and three.js and dat.gui

441 Views Asked by At

I am using django as backend and model.form for data saving. i am using dat.gui with three.js scene. my question is how do i save dat.gui parameter to django. (how to get dat.gui parameter to django form)

1

There are 1 best solutions below

1
On

The dat.gui API has a .getSaveObject() call. Call that, do JSON.stringify() on the result value and send the string to your backend (e.g. using fetch()).

You can then use gui = new GUI({load: saveObject}); when instantiating your dat.gui to load the state.