Forum

User posts mariosds
13 February 2017 22:30
Hello there,

On a previous post of mine , https://www.blend4web.com/en/forums/topic/3022/ , 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
11 February 2017 20:33
This is exactly what i was looking for. You saved me from a lot of trouble. Thank tou very much!
09 February 2017 22:18
Hello all,

I was wondering if there is a way i can pick the real coordinate of a spot after a click on the canvas.
For example: In blender, wherever i take the 3d cursor i can have it's coordinates(x,y,z) on the right panel. Can i do the same in the browser after i click on the canvas? Any ideas?

Thanks!!