Jump to content
Alexey Vanzhula

Get point near the mouse cursor

Recommended Posts

If the origin is a proper 3D point with depth already accounted for, this should be relatively easy:

origin = (1, 1.2, 0)
op = hou.pwd().inputs()[0].path()
expr = 'nearpoint("{}", {}, {}, {})'.format(op, *origin)
pt = int(hou.hscriptExpression(expr))

 

  • Haha 1

Share this post


Link to post
Share on other sites
6 hours ago, f1480187 said:

If the origin is a proper 3D point with depth already accounted for, this should be relatively easy:


origin = (1, 1.2, 0)
op = hou.pwd().inputs()[0].path()
expr = 'nearpoint("{}", {}, {}, {})'.format(op, *origin)
pt = int(hou.hscriptExpression(expr))

 

The problem is how to find the depth in the "air" :).

When the line (from ray and origin) intersects with the surface it is not a problem.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×