Advertisement

07.25.2007 at 07:23PM PDT, ID: 22721723
[x]
Attachment Details

pick object with mouse - Direct3D

Asked by jhshukla in C# Programming Language, DirectX Graphics & Game Programming, .Net Editors & IDEs

Tags: direct3d, directx, mouse, object

How can I determine which object is drawn at a particular pixel?
Currently my program calls DrawUserPrimitives, which takes in as data CustomVertex.PositionColored[].
since z-buffer is enabled there must be easy way to determine the polygon at the pixel. but that still leaves the challenge to determine the array from which it came. Seems like I must use some other API to render the objects.

my other option is to compute on-screen bounds of the object. precision is not important. an approximate rectangular box is acceptable. this seems to be simpler but tedious on my part.

Then there is the issue of dragging the object around. The object moves along a horizontal surface. So this time I have to compute world coordinate from screen coordinate.

how should I go about solving this?

btw, I am using .NET 2.0 managed DirectX libs.Start Free Trial
[+][-]08.03.2007 at 10:15AM PDT, ID: 19626822

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: C# Programming Language, DirectX Graphics & Game Programming, .Net Editors & IDEs
Tags: direct3d, directx, mouse, object
Sign Up Now!
Solution Provided By: Javin007
Participating Experts: 1
Solution Grade: B
 
 
[+][-]08.03.2007 at 02:23PM PDT, ID: 19628692

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.06.2007 at 07:30AM PDT, ID: 19638558

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.06.2007 at 04:12PM PDT, ID: 19642319

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.07.2007 at 05:40PM PDT, ID: 19650719

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.10.2007 at 09:18PM PDT, ID: 19674858

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.02.2007 at 05:08AM PDT, ID: 19816853

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]09.02.2007 at 04:36PM PDT, ID: 19818422

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32