high procesion position in 3D when using processing -
processing offer 3d features when using p3d or opengl argument in size function,in 2d scenes.we can postion mousex , mousey,but in 3d,how can mouse?
there no direct way get, say, mousez
since mousex
, mousey
tell mouse on window, 2d nature.
however, there called 3d picking looking for. simple process:
the ability match mouse click on window showing 3d scene primitive (let's assume triangle) fortunate enough projected exact same pixel mouse hit called 3d picking.
you can read detailed explanations , implementation tutorials on here: http://ogldev.atspace.co.uk/www/tutorial29/tutorial29.html , http://schabby.de/picking-opengl-ray-tracing/ (done opengl).
there is, incidentally, picking library processing 2+ can here: https://github.com/nclavaud/picking library comes 2 examples see how implemented.
to better search results on this, use 3d picking
search term , you'll lot of results on google.
Comments
Post a Comment