Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Centre view on a circle (Directx/Direct3d)

Options
  • 02-05-2006 1:10pm
    #1
    Closed Accounts Posts: 4,943 ✭✭✭


    Basically, i have a little app going on where the app renders a direct3d surface, and the user can click on various items that are being rendered so they can centre the view on that item.

    Now, the problem i'm having is that i can't make the view centre on one of the objects by using a mouseclick. I can get the mouseclicks coordinates relative to the 3d window. i.e. i can say they were at coordinates 100,200 i.e. 100 to the right and 200 down from the top left corner. I can then take those coordinates, and remap them slightly so as to tell which way i should move the view. I can get it so that the view moves in the right direction, but i can't make it move the right distance. i.e. they'd click on a circle in the top left, and it would move up and left BUT it woudl move much to far.

    So how can i convert the mouse coordinates into proper "directx" coordinates so i can tell on what item they clicked on in the direct3d window. A perfect example of what i mean is demonstrated in www.liveplasma.com. You can select items by "clicking" on them. How can i achieve the same effect.

    I'm coding in C# using managed directx.


Comments

  • Registered Users Posts: 5,112 ✭✭✭Blowfish


    I haven't done it using directx, as i'm an opengl man, but the correct phrase for it is 'picking' theres a link here, but if that is no good just google 'directx picking' and you should find something.


  • Closed Accounts Posts: 4,943 ✭✭✭Mutant_Fruit


    Thats brilliant. I've been googling the problem a bit, but i havn't come across "picking" as of yet (most of my problem was i didn't really know what term i was supposed to google).

    I'll give that a shot later on today. Hopefully i can make it work for me.


Advertisement