Closed reconlabs-chris closed 7 months ago
Some options:
scene.translate(new SPLAT.Vector3(1.0, 1.0, 1.0))
(as an example)alpha
, beta
, and radius
to the OrbitControls
.OrbitControls
, in which case you can just set camera.position
and camera.rotation
directly.Thank you for your response. However,
1.While moving the entire scene works, it's not very intuitive, as I have to calculate the camera's position relative to the entire scene. 2.Once I set those values for orbitalControls upon its initialization, it seems that I cannot achieve the desired camera position due to the constant min/max zoom settings. 3.I attempted to manually set the camera's position and rotation upon initiation. However, it appears that these values are being overridden in orbitalControls, as I can't manually change its "desiredTarget" value (this is my assumption).
Once again thanks for the great work and It would be great if you can help me.
It makes sense that you should be able to change the initial target position of the orbit controls, I will work on an update so that you can change that.
Thanks a lot!
Also It would also be nice if we could modify the camera not only during initialization but also at any time while the scene is active. There are situations where I need to programmatically control the camera.
+1 this feature would be very nice.
Would also be really nice to be able and set XYZ for the object, currently some of my tests end up with the object leaning and generally just not upright, which destroys the orbit camera functionality.
+1 this feature would be very nice.
Would also be really nice to be able and set XYZ for the object, currently some of my tests end up with the object leaning and generally just not upright, which destroys the orbit camera functionality.
In that case you can call scene.translate()
and scene.rotate()
. Or, there is this tool that can help you reorient scenes: https://github.com/playcanvas/super-splat
+1 this feature would be very nice. Would also be really nice to be able and set XYZ for the object, currently some of my tests end up with the object leaning and generally just not upright, which destroys the orbit camera functionality.
In that case you can call
scene.translate()
andscene.rotate()
. Or, there is this tool that can help you reorient scenes: https://github.com/playcanvas/super-splat
That's perfect, thanks for the suggestion.
This issue has now been addressed in the latest patch :) You can pass a target to the OrbitControls, and orbit controls will listen for explicit position/rotation sets on the camera and adjust accordingly.
It appears that OrbitControls cannot detect changes in the camera's position made using camera.position.set(x, y, z). It can only detect changes when the camera's position is completely replaced with a Vector3, which can be somewhat confusing.
Thanks, I'll open an issue and fix that
For now I removed the math setters and made properties immutable to fix that issue while keeping the math classes as simple as possible
When loading a splat file, I'd like to set the initial camera position to a specific location. How can this be achieved?