I have successfully created a line mesh with an elliptical shape to represent an orbit with eccentricity e and semi-major axis a. This mesh is a child of a group named orbitGroup, which also contains other objects. In addition, I have implemented a GUI to adjust these parameters. Whenever the GUI is changed, it triggers the following function:
function ElementsUpdate(){
scene.remove(orbitGroup);
orbitGroup.remove(Orbit);
Orbit = undefined;
Orbit = new THREE.Line( GetGeometryOrbit(GetOrbitLine(a,e,100)), materialOrbit);
orbitGroup.add(Orbit);
scene.add(orbitGroup);
}
Although the mesh (Orbit) is created successfully, it does not update as expected. I am aware that the setGeometry
method is no longer effective. Is there any solution to this issue? I am opting to replace the entire mesh instead of just updating the geometry, which seems more complex.
Thank you in advance for any assistance provided.
You can view the project at this link