Difficulty arises when switching between the coordinates of a wavefront (.obj) in three.js

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.

Answer №1

The initial feedback was successful by enabling the needsUpdate to be true;

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Contrast between sourcing a file from the current directory versus from the node_modules folder

Why does the typescript compiler accept importing from a JS file in the local directory but raises an error when importing from node_modules? Code: import { t2 } from "./t1.js" t2.hello(); import { mat4 } from "./node_modules/gl-matrix/esm ...

JavaScript XMLHttpRequest is always essential

I am currently working on a chat application that needs to constantly receive server information. After the request finishes, I have added an additional call to the function within the http.onreadystatechange=function() like this: request(); This sets ev ...

Utilize the composition API in Vue.js 3 to call a function and pass in a parameter

I'm having trouble calling a function from another component. When I click on a button in my parent component, formTelemarketing(), it should send data to my other component nAsignedCalls() and call the function getCalls(param) in that component. Thi ...

Connect tinyMCE to knockout.js

Learn how to utilize tinyMCE custom binding using. public sealed class CabinetShapeEditModel { public string Description { get; set; } } When implementing in the view: <script type="text/javascript"> var jso = @Html.Raw(Json.Encode ...

Alert from module (from ./node_modules/laravel-mix/node_modules/postcss-loader/dist/cjs.js):

I'm facing an issue while trying to set up the laravel breeze package for default authentication in my Laravel 9 project. After running npm run dev, I encountered a Laravel Mix error. WARNING in ./resources/css/app.css (./node_modules/css-loader/dis ...

After deploying a Next.js project on an Ubuntu server, dynamic pages are returning a 404 error

I've been putting in a substantial amount of time on this project. I'm encountering some 404 errors on my dynamic pages, even though they work perfectly fine on localhost. I've tried using revalidate and playing around with fallback: true an ...

What is the best way to create fading text effects in an AngularJS application?

Running an AngularJS web application that showcases three words for 5 seconds each: Hello, World & Goodbye. The controller setup is as follows: self.currentIndex = 0; self.myTexts = ['Hello', 'World', 'Goodbye']; self.cu ...

The mystery of web3.eth.getAccounts() in the world of React Native and Metamask authentication

My goal is to authenticate the user using their Metamask wallet. To achieve this, I am utilizing the web3 package for interacting with blockchain and signing transactions. However, I am encountering an issue where attempting to retrieve user accounts resul ...

Confirming the presence of values following hyphens in a string

Can you help me with this? I want to create a function that checks if the string below (represented by var x) has values after each of the 7 dashes and returns valid or invalid var x = 4-D-5240-P43-120-08A2-8123-0000 (valid) Here are some examples where ...

What steps should I take to retrigger the function when I click on it a second time?

Is there a way to make the ball trigger the bounce function repeatedly in JavaScript? I want it to bounce more than once on click. <script> var ball = document.querySelector(".ball"); var blo = -2; function bounce(){ va ...

Calculating the time difference between two dates in the format yyyy-MM-ddTHH:mm:ss.fffffff can be done by following these steps

Can someone help me figure out how to calculate the difference in days between the date and time 2021-02-23T08:31:37.1410141 (in the format yyyy-MM-ddTHH:mm:ss.fffffff) obtained from a server as a string, and the current date-time in an Angular application ...

Include a personalized header in $http

In my factory, I have multiple functions that follow this structure: doFunction: function () { return $http({ method: 'POST', url: 'https://localhost:8000/test', data: {}, headers: { "My_Header" ...

What are some alternatives for appending after something?

<table border="2"> <tr><td>one</td><td>two</td></tr> <tr><td>one</td><td>two</td></tr> <tr><td colspan="2" id="new" >add new</td></tr> </ta ...

What is the best way to retrieve a {collection object} from a JavaScript map?

My application utilizes a third-party library that returns the map in the following format: public sids: Map<SocketId, Set<Room>> = new Map(); When I try to access it using the code below: io.of("/").adapter.sids.forEach(function(va ...

Tips for adding a "return" button to a page loaded with AJAX

While working with jQuery in prototype to load pages using Ajax, I've come across a feature on big sites like Facebook and Twitter that I'd like to implement: a 'back' button that takes the user back to the previous page when clicked. S ...

What is the best way to create a basic accordion using only certain table rows?

I am faced with the task of transforming a HTML table that lists various items. Each <tr> within the table contains a unique title element, but there are cases where rows can share the same title indicating their relation. My goal is to implement jQu ...

Conceal the Div element in the loop if there is no image present

Im trying to set a condition in my WordPress loop. If there is no image, then the image box (.thumbHome{display:none}) should not appear. This is what I have in my function.php: function getThumbImages($postId) { $iPostID = get_the_ID(); $arrImages =& ...

Is there a method to incorporate a library into a project so that it can be utilized universally across all files without the need to constantly require it?

I'm curious about the following: I manage a library and am wondering if there's a way to implement a feature where, upon installation in a Node project, I can easily call the main function without having to explicitly import it into each file. D ...

What is the best way to generate a new object within a function and then return it

The function performs the following steps: Retrieves an XML document through AJAX. Identifies relevant information within the document. Dynamically converts it into an object using a for loop. How can I access this generated object outside of the functi ...

Why is my "webpack" version "^5.70.0" having trouble processing jpg files?

Having trouble loading a jpg file on the Homepage of my app: import cad from './CAD/untitled.106.jpg' Encountering this error message repeatedly: assets by status 2 MiB [cached] 1 asset cached modules 2.41 MiB (javascript) 937 bytes (rjavascript ...