Hello
https://developer.playcanvas.com/en/tutorials/planet-earth/
I want to add rotate by click to this example.
when user click on earth, the clicked point is exactly in front of the camera
How can Rotate The Earth wherever clicked on earth ?
Hello
https://developer.playcanvas.com/en/tutorials/planet-earth/
I want to add rotate by click to this example.
when user click on earth, the clicked point is exactly in front of the camera
How can Rotate The Earth wherever clicked on earth ?
Hi @JANGOZ,
For something like that you will need to calculate the require rotation to animate the camera to that point on click.
You could use a dummy parent/child entities for that:
Thanks
I have positions of surface and globe !
How can I do number three ? (Get the rotation of the child entity.)
You can use entity.getRotation() or entity.getEulerAngles() to get it, and apply it to your camera. Just note if you apply it at it is then the camera needs to have a similar hierarchy (parent/child entity).