Advertisement

Help with mouse picking in D3DIM

Started by February 14, 2000 05:52 PM
2 comments, last by Paranoid69 25 years ago
Does anyone have an example of or know how to do mesh/vertex picking in D3DIM. I know it''s easy in RM, but I can''t find and samples of it in IM. Thanks.
Are you trying to point at the screen with the mouse, and see what triangle you''re pointing at?

There''s a D3DIM function called PICK that''s supposed to do it. I''ve never used it, because it clashes with my method
of drawing.

You might check if out.
-- Goodlife-----------------------------Those whom the gods would destroy, they first drive mad.--DirectX design team official motto
Advertisement
The method I use is to have the object in a Vertex Buffer. Then ProcessVertices into another Vertex Buffer. The second vertex buffer now contains the screen coordinates of each vertex, then I can compare the screen position of the click to the screen position of the vertices to find out which one was clicked. It sounds slow, but it''s really not bad. You do, however, have to make sure when creating your vertex buffers that they are in system memory, not video because reading the transformed vertices from video mem is SLLLLOOOOOOWWWWWW!

Good Luck.
Thanks a ton, I''ll try the VertexBuffer process out.

As for the Pick function, that got removed with DX7.

Thanks again.

This topic is closed to new replies.

Advertisement