Problem when toggling between the coordinates of a wavefront (.obj)

So I have a slider in my HTML with values ranging from 1 to 2. When I have the slider value set to 1, I want to set the coordinates of my wavefront to the one described by arrayMin and when the slider is set to 2, I want the coordinates of my wavefront to set to one described by arrayMin.

man is the name of the variable that I used to load the obj in threejs using OBJLoader.

function render(time)
    {
        let valueOfSlider = document.getElementById('mySlider').value
        scene.remove(man)
        if (valueOfSlider == 1){
                console.log("I want arrayMin to be set")
                man.children[0].geometry.attributes.position.array=Float32Array.from(arrayMin)
            }
        else
        {
                console.log("I want array Max to be set")
                man.children[0].geometry.attributes.position.array=Float32Array.from(arrayMax)
        }
        scene.add(man)
        controls.update()
        renderer.render(scene,camera)
        requestAnimationFrame(render)
    }

/cc

I am actually the same guy who posted in stack overflow !

Please bear in mind that crossposting can lead to the situation that two devs provide the same solution at the same time and thus do redundant work. To avoid this, it’s better if you share the places where you post the identical question.

1 Like

Oh okay sure. Thank you for the reminder :slight_smile: