Jump to content
  • Advertisement
Sign in to follow this  
ashwathh

3D Cylinder.

This topic is 3280 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

Hello All, I have a .x(DirectX) file which i got from converting .3ds to .x file.I am rendering a 3D object(hollow cylinder)on the screen using the function "D3DXLoadMeshFromX" and "DrawSubset(0)".When i click on the cylinder and drag it then the cylinder should deform and it should look like a rope.How i can achieve this.Please help me in this. Thanking you in advance, Ashwath.

Share this post


Link to post
Share on other sites
Advertisement
You could apply a scale matrix to the cylinder mesh, scaling the mesh along it's main axis. If you don't need or want to actually change the mesh vertices, this is probably much easier. This method will result in a straight but stretched cylinder.

If you want the cylinder to curve in several places as you click and drag the mouse, you will need an algorithm to modify the vertices in the mesh vertex buffer, according to how you want the cylinder to change as you drag the mouse. That method will probably involve picking the triangle in the mesh where the mouse is clicked.

If you want to use the second method, the first thing to do is to write a routine for picking the correct location on the mesh. Look at the D3DXIntersect functions and get that working before you try to deform the mesh.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!