Open crunchwrap89 opened 1 year ago
Hi, I made an update to this issue description, added some useCases for the suggested Virtual Camera and also added an "Almost" working code example of how it might work that was calculated by @usefulthink
The above code example works fine for utilizing object.lookAt(_vCam.position), but there is some small factor missing. Hopefully you can help and this might be added to the package. :)
Love this package btw! <3
Any chance this will be made? :) Im still looking for ways to implement tranform controls on the webgloverlayview.
Br Marcus
I'm pinging this thread because I am also needing some sort of virtual camera attached to my project. In my specific case, I am trying to work with CSS3DRenderer
, but I can't seem to place my instances of CSS3DObject
in the correct place; despite I already found how to get the virtual camera position, like @crunchwrap89 reported, there's a small factor missing in the calculations, and I can't seem to find it.
Are you already trying to implement this feature, @usefulthink ?
Any sort of feedback would be appreciated. Thanks in advance!
The problem
When i was trying to add the Transformation Controls from the Three.js utils and attach it to a 3D object i stumbled upon some issues.
Attaching the TransformationControls to the 3D Object works fine, i can see the Controls and the position and axis is correct after the latest major update to the package. However.. interacting with the TransformationControls does not work. Nothing happens when clicking/dragging the controls.
When dragging the controls it should translate the objects position on the map. This currently doesnt work due to how the current camera is positioned.
Feature request
After discussing this with Martin we concluded that the solution to this issue would be to add a virtual camera, that "sees" the same as the actual maps viewport sees. Then that virual camera can be passed to the TransformControls and then the internal raycaster of the Transform Controls should work as intended.
There are more use cases for adding a virtual camera that "sees" the same as the actual maps viewport. Here is a list of some that i can come up with:
Usecases
Here is a suggested calculation for setting the position of the Virtual Camera on each frame update. It Almost works, there is one small factor missing but i could really use your guys help to figure out what piece of the puzzle is missing.