Jump to content
  • Advertisement
Sign in to follow this  
Grattier

[MDX] PLEASE HELP !! Drag And Drop?

This topic is 4547 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have an Object Camera that let me rotate around my target... but now. i want to be able to drag and drop the object using right button... any ideas where i can find a tutorial about that? I'm able to make it move but never like I want... [Edited by - Grattier on February 7, 2006 7:37:03 AM]

Share this post


Link to post
Share on other sites
Advertisement
Hi,

I don't know if you have managed picking already, in case not, then you'll find many threads on the forum about picking (like this).

After you know which object to move, then you'll have to ask yourself: which is the surface you want your object to move on? As you can imagine, a single pixel on the screen, on which you point your mouse, corresponds to an infinite number of points in 3D space, standing on the line right behind your cursor.
Once you know which surface or distance is the one, then you just intersect the ray coming from the eye, through the mouse cursor, with the your surface, and place the object there.

Hope this helps,
kp


Share this post


Link to post
Share on other sites
My big problem is that i'm not using mesh... i create my object with vertex/index ... and i don't know how to retreive the intersect information from custom stuff

Share this post


Link to post
Share on other sites
Hi,

if you have vertices and indices, then you have a mesh, don't you?
you just have to wrap it, if you need an ID3DXMesh.
On the other hand, you don't have to intersect if you want to pick. We here use a method that renders a "pick screen", on which every object is rendered, but using object ids, face ids, etc as colors. Then, the object right under the mouse can be looked up from this render target texture. It's not optimal in the sense of speed, but it works pretty good.

kp

Share this post


Link to post
Share on other sites
I set some vertices / index... and after i make many device.DrawIndexedPrimitives(PrimitiveType.TriangleStrip .. something like 300 times... and the final result is my object. It's not for a games it's a really specific apps.

I know how to get the start / direction.. now all i want to know is.. wich DrawIndexedPrimitives is selected in my 300!

Thanks a+

Share this post


Link to post
Share on other sites
Perhaps you could intersect your ray with just the bounding volumes of your primitives - would that do?
Failing that I'm afraid you'll have to go through all the faces and intersect your ray manually!

Share this post


Link to post
Share on other sites
Yes i can go through the bounding volumes of my primitive...

In fact, that's what i'm working on for now.. the Only big problem that i have now.. is the intersect...

I have my Start and my direction... but i can't figure how to test the intersect manually..

Exemple:
Start at: 34000, 0, 96000
Direction: -0.99, 0.25, -0.03

I understand what's the meaning of that.. but I can't figure how to use it..

with mesh it's easy.. intersect(start,direction,device) something like that... bu it's not for a mesh

If i click on my object, I need to compare this information and see if it's going though my object somewhere (my object can be separate into many box) and put a special effect on this "parts" (box) ..

Share this post


Link to post
Share on other sites
Please help me..

I have my Direction MAtrix and my Start Matrix... and i know bounds of my object... how can i know if i clicked it?

Share this post


Link to post
Share on other sites
Ok so here is my PICKING solution:

Use Geometry.BoxBoundProbe( lower-left corner, upper-right corner, start, direction)

It work great!


Now i need to know my destination distance

[Edited by - Grattier on February 7, 2006 7:12:31 AM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!