DirectX 3D Image Display.
-
Hi All, The task which is given to me is that i have to show a cylinder in 3D.Then when i click on any part of the cylinder and drag the mouse i should be able to deform the cylinder and when i leave the mouse the object should be in the last deformed state.I am planning to use directx for this. Any inputs from you will be very helpful for me. Thanking you in Advance, Regards, Ashwath.
-
Hi All, The task which is given to me is that i have to show a cylinder in 3D.Then when i click on any part of the cylinder and drag the mouse i should be able to deform the cylinder and when i leave the mouse the object should be in the last deformed state.I am planning to use directx for this. Any inputs from you will be very helpful for me. Thanking you in Advance, Regards, Ashwath.
I'm guessing, based on your post that you have not done much Direct3D programming (otherwise, you'd know the answer). Can you display a just a cylinder (without any modification)? That would be the obvious starting point. Wireframe? Solid? Lighting? What version DirectX? You leave out alot of important details. You should initially query the capabilities of your graphics device. But, essentially, I think you will want to coordinate the output of a number of standard DirectX APIs: Direct Input (to respond to the mouse action), and, the display of the cylinder data. The way I'd do it would be to implement a cylinder Mesh (which is a standard DirectX object), and which gives you access to the Vertex Buffer and Index Buffer (and all the other data you'll need). The easiet method would be to implement a series of drawing calls using a progressive algorithm that deforms the Mesh by some simple metric. You would be writing data to the Vertex Buffer and then displaying the Mesh. Also, there is a Graphics Forum here at CodeProject, where you'd probably get a better answer.