Currently, I am dealing with a slider in my HTML code that has values ranging from 1 to 2. When the slider value is set to 1, I intend to adjust the coordinates of my wavefront as described by arrayMin. Conversely, when the slider is at 2, I wish for the wavefront coordinates to reflect those outlined by arrayMin.
The variable "man" is what I've designated for loading the obj in Three.js using OBJLoader.
function render(time)
{
let sliderValue = document.getElementById('mySlider').value
scene.remove(man)
if (sliderValue == 1){
console.log("Setting arrayMin")
man.children[0].geometry.attributes.position.array=Float32Array.from(arrayMin)
}
else {
console.log("Setting arrayMax")
man.children[0].geometry.attributes.position.array=Float32Array.from(arrayMax)
}
scene.add(man)
controls.update()
renderer.render(scene,camera)
requestAnimationFrame(render)
}
Unfortunately, this implementation is not working as expected. If you check this screenshot image, you'll see the log reflecting an absence of the needsUpdate field.