Adding compass to the scene

I need to add a compass to my scene like this. Do we have any sample code for that?

2 Likes

Hi!
From the twilight zone of my mind at 1:45am, a solution, based on the world direction of a camera and respective rotation of an html-element (SVG actually):
https://jsfiddle.net/prisoner849/gpbyw3co/

Compass

PS Not the ultimate solution, just an option.

14 Likes

Beautiful! Thanks for sharing!
-=(RLH)=-

1 Like

Hi @prisoner849 ,
The link seem to have been outdate with newest threejs build.

there’s a clone of this example i was trying to debug. Ended up just updating the file version.

here’s the working sample Edit fiddle - JSFiddle - Code Playground

3 Likes

How would some one reverse the process of this? Lets say I want to rotate the camera 180 degrees. How would I do that?