XNA Creators Club Online

sample details

Picking with Triangle Accuracy
Sample
submitted
6/28/2007

Description:

This sample shows how to access vertex position data from a model. It then uses that information to implement a per-triangle picking test.


Sample Overview:

This sample builds on the ideas presented in the Picking sample. If you are unfamiliar with the process of converting between world space and screen space, and checking for intersection between rays and bounding primitives, you should start with the Picking sample, which explains these basic concepts.

This sample extends the approximate bounding box tests from the Picking sample to perform an accurate per-triangle picking test. It loops over all the triangles in the model, performing a ray-to-triangle intersection test for each one. It uses a custom content processor to extract the model vertex position data into a format that can be easily accessed at run time.

downloads
Framework

GS 2.0

Vertex Shader Version

VS 1.1

Pixel Shader Version

PS 1.1

var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG