O'Reilly logo

3D Programming for Windows® by Charles Petzold

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Introduction to Hit-Testing

At times you'll want to allow the user to interact with 3D objects using the mouse. The first step is a job called hit-testing. Your program obtains the two-dimensional point of the mouse and determines the object under that point. Specifically, when working with 3D visuals, your program obtains the ModelVisual3D at the mouse coordinates. More than one visual may be overlapped at that point, so you can obtain first the ModelVisual3D on the foreground at the mouse coordinates, and then the ModelVisual3D objects farther in the background. With the specific ModelVisual3D, you also obtain the GeometryModel3D, the MeshGeometry3D, the coordinates of the particular triangle, and weights that indicate the precise point within ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required