Adding Spots on Object

13 February 2017 22:30
Hello there,

On a previous post of mine , , i was asking how i could take the real coordinates of a mouse click so i could add a spot on my obj. This happened thanks to Ray Test example!!! After this, i mean after adding some spots-flags on my obj i wanted to "save" them to stay on the object.

So , i thought after on_click on the container take those clientX, ClientY that mouse_cb function needs to run and store them in a database. I made a replica of mouse_cb function waiting for parameters (x,y) and i give those parameters after pulling them from the database. I repeat call mouse_cb for all my spots-flags in the database. This works fine but another problem appears.

The problem is that ClientX, ClientY depends on the client's screen, the current zoom, and the camera's position. So if i run the app from another pc (with different screen dimensions or differnet zoom) the spots appears in different position or not at all.

So, which is the most proper way to achieve that? I hope i explained it well. Ask me for anything you didnt understand.

Thank you
Please register or log in to leave a reply.