mouse capture in viewport

Anonymous 5 years ago 0
This discussion was imported from CodePlex

alexalthauser wrote at 2013-04-03 23:43:

I'm trying to show the x,y,z position of the mouse within the helix3d viewport. I was wondering if there are any examples or samples, that show how to do this?

I'm building a 3D level editor, with a 3D grid, used for positioning objects. When the mouse moves through the grid, I want transparent planes to light up each side of the cube which the mouse is over, within the grid.

So far I have the X & Y mouse coordinates of the HelixViewport3D. I forget how to get the z coords. It's Camera lookat direction multiplied by something.. Arg, can't remember. Help!


objo wrote at 2013-04-15 12:22:

See the CurrentPosition property in the HelixViewport3D control.
Or use the Viewport3DHelper.Point2DToRay3D function. You can then find the intersection of the Ray3D and a Plane3D.
See also the "VoxelDemo" in the "ExampleBrowser".