hi, I’m using vue+vuex to develop a website, but I meet some problems, please help me.
I have a nurbs surface which is ready, and the points are stored in vuex this.$store.state.nurbs, but when I create geometry buffer, I can’t import it into ParametricBufferGeometry
const getNURBSSurfacePoint = (function (NURBS) {
return function (u, v, target) {
// input target = new THREE.Vector3()
// modify target by target.set(x,y,z)
// return void
target.set(
NURBS[u][v][0] /NURBS[u][v][3],
NURBS[u][v][1] / NURBS[u][v][3],
NURBS[u][v][2] / NURBS[u][v][3]
)
}
})(this.$store.state.nurbs)
let geometry = new THREE.ParametricBufferGeometry(getNURBSSurfacePoint,
this.$store.state.nurbs.length,
this.$store.state.nurbs[0].length)
after run
npm run dev
the webpage warns
this.$store.state.nurbs[u] is undefined
can anyone help me?
I saw the example of nurbs in three.js source pack.
if I construct a new object like it, it would occupy much memory, also the data copy in memory would slow the program down. my current method JavaScript closure is much faster, but I don’t know why it doesn’t work.
or I have to develop ParametricBufferGeometry function by myself, it’s so difficult, and I don’t know what hidden problems are in my modification. I really don’t want to do that.