spirit-code / spirit

Atomistic Spin Simulation Framework
http://spirit-code.github.io
MIT License
117 stars 52 forks source link

Feature request: print position of mouse in UI #448

Closed SpiritSuperUser closed 3 years ago

SpiritSuperUser commented 6 years ago

It would be nice to have the current position of the mouse printed somewhere in the UI. Ie., in "System" visualization the coordinates could be shown while in "Sphere" visualization the corresponding angles are printed.

GPMueller commented 6 years ago

Though I agree it would be somewhat nice, would this have any practical use?

SpiritSuperUser commented 6 years ago

yes :) if you have a somehow meaningful system and want to place for example a skyrmion at a particular position without the fear of destroying everything by placing it at a wrong position, it would be good to know where. so you check the position of interest with your mouse and then you place the skyrmion there. on the sphere, it would just be nice to have direct access to the orientation of single spins, so you place your mouse on one spin and know theta and phi..

GPMueller commented 3 years ago

The mouse position can currently not be calculated by ray-intersection with the bounding box. Therefore, to get reliable numbers, the camera needs to be aligned to the z-axis and use orthogonal projection. Therefore, I would only add this for the interaction modes, in which an additional info-widget could be shown:

image

This has been done with 3c7f550d69b72c5c7805a42cb35568d9b0f96af0 on branch feature-imgui.