Restore camera properties irrespective of controls

No, because something like this…

  1. Is difficult to maintain when all individual controls have their own relative maintenance updates (again feel free to make a PR and actively maintain a class such as this, considering ArcballControls has over 3200 lines of code alone, you could only imagine the problematic stress of maintaining a class that can be actively updated and function in the way you describe)

  2. Is very rarely, if at all, required by 99.9% of users

  3. Would not be modular and can be composed from the easier maintained and modular individual controls classes by a user that does require this type of functionality.

I think you’ve got the wrong end of the stick here, if people concerned themselves with spending all their time on trying to maintain an ever growing “brainstorm” of sketches where absolutely nothing is manageable, nothing is refined, no blueprint is ever distilled, nothing would ever advance, leaving you with an unusable, clunky, indescribable mess of an idea.

Imagine trying to build this…

without this…

i can tell you seem to be in a bit of a pickle over the logic on this but in all fairness the only “demands” here are coming from you about how maintainers of the library don’t seem to be catering to your 0.001% use case, take a chill, try to be understanding of peoples time, knowledge, resources, make it easy for people to help and people will be more inclined to help you, who know’s, you may just get some answers.

In your demo the switch case never increments, nonetheless, the main logic missing in your code is that both ArcballControls and OrbitControls generate a new THREE.Vector3() as a target property on the creation of those particular controls, this needs to be calculated and set to achieve what you’re after, otherwise, of course, your controls.target will always be a new THREE.Vector3() with the default values (0,0,0).

In using the logic from this post you can calculate the controls.target before destroying the previous set of controls. By first calculating the forward vector of the camera and adding that to the camera’s position, you can then use controls.target.copy(lookat) when generating either of those control types in your switch case, feel free to take a look through this logic in the fiddle provided above ^^^ and let us know if this makes sense to what you’re trying to achieve…

1 Like