Original Post
I have a 7x7x7 block of cube meshes and want to have the mouse be able to select the one under the cursor. I have searched the forum and im still not completely clear on how to do this.
- I know where the Camera is positioned and is facing.
- I know the offset from the origin to which i have translated each of the cubes in the 7x7x7 block.
- I am aware of the functionality of the D3DXIntersect function.
- When ever the mouse button is pressed i loop through all 343 cubes using the D3DXIntersect function, checking the bHit return variable for true. I can then act upon the trueness.
- I have tried some of the various explanations of how to transform the vPickOrig and vPickFacing vectors to allow for the translation of the cubes (and camera?). None of them seem to affect the selection process. These involved subtracting the position of each mesh and the camera from the vPickOrig and vPickFacing vectors.
I won''t include my code cos it aint a syntax problem, i kinda need to know the principles behind how this works. I do get the picking registering in certain areas of the screen but not in others, and the areas are kinda always close to the cube meshes so i have a feeling i''m not far off.
Can anyone please help me on this matter.
If ya need some of my code i will post later.
regards,
ace