# Skinning a mesh.... need help

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

## Recommended Posts

Hi, i started to look at directX last week and now i want to know hot to play with my mesh.. I created a mesh in Maya that is a Cylinder with many vertices. Now my program load it and let me see the total number of vertices and faces (Progressive mesh). Now i want to transform some vertices... i think it's called "Skinning". I don't have animation stored in my X file and i don't want animation... i want to transform my mesh as i want using coding. How it work? Thanks

##### Share on other sites
It's not completely clear what you want. Skinning means displacing/transforming individual vertices according to an (animated) bone system. Since you don't want animation, you probably don't mean skinning.

Transforming a mesh as a whole is something different and much simpler. In DirectX this is done by ajusting the world matrix before rendering the object. The D3DX-framework that comes with DX provides some easy functionality for this. For example, to translate the mesh five units away from you (looking down the Z-axis):
D3DXMATRIX matTransform;D3DXMatrixTranslation( &matTransform, 0.0f, 0.0f, 5.0f );m_pDevice->SetTransform( D3DTS_WORLD, &matTransform );m_pMesh->Render();

Illco

##### Share on other sites
Ok... i dont want to move the mesh but physically transform it...

Example: My mesh is a cylinder and i want it to look like a wood log with some 3d details..

Anyone?

##### Share on other sites
You'll really just have to model it to look like a log, in your modeling program choose the wire frame view, them grab groups of vertices (which make up the log), and just move them about a bit, you might have to realign quite a few and it takews a while. You could also put a couple smaller cylinders in there (sticking out of the log), for branchs, and bend them around a bit as well.

##### Share on other sites
Yes i know that i can do that... but i can't do that and i explain:

It's a program that receive many informations on the log and with those informations.... create a log in 3D .. it's something like a Terrain Generator but it's a Wood Log Generator... without branchs...

I want to know the easier way to do that... with a mesh that i transform some vertices or build it with many primitive each time...

##### Share on other sites
look in the sdk tutorials folder, there is one, where they make a cylinder just from algorythmicly (taylor series), maybe that could help as a start.

..Program Files\Microsoft DirectX 9.0 SDK (Summer 2004)\Samples\C++\Direct3D\Tutorials

##### Share on other sites
..also look into vertex tweening

##### Share on other sites
Look up "morph targets". That is an animation technique that transforms one shape into another, such as a cylinder into a log.

##### Share on other sites
Ok thanks a lot guys.. i'll take a look to all those stuffs and come back give you my feedback

a+

##### Share on other sites
Quote:
 Original post by Anonymous Posterlook in the sdk tutorials folder, there is one, where they make a cylinder just from algorythmicly (taylor series), maybe that could help as a start...Program Files\Microsoft DirectX 9.0 SDK (Summer 2004)\Samples\C++\Direct3D\Tutorials

I have December 2005 SDK and i really can't find anything like that... can you zip me the tutorial and send me ?

##### Share on other sites
I really didn't understand how it work.... I'm able to build a mesh from primitive, load a mesh, zoom / rotate / scale a mesh but Transform a mesh like a want.. I'm not able... anyone have a good sample? I can't find the (Summer 2004) sample

##### Share on other sites
Quote:
Original post by Grattier
Quote:
 Original post by Anonymous Posterlook in the sdk tutorials folder, there is one, where they make a cylinder just from algorythmicly (taylor series), maybe that could help as a start...Program Files\Microsoft DirectX 9.0 SDK (Summer 2004)\Samples\C++\Direct3D\Tutorials

I have December 2005 SDK and i really can't find anything like that... can you zip me the tutorial and send me ?

The tutorials haven't changed much over the years, and they've always been in \Samples\C++\Direct3D\Tutorials\ as far as I can remember. The first part will obviously depend on your SDK's install location, but beyond that they should be there [smile]

Baring in mind that you only started with DirectX recently, you might well want to slow down a little bit and make sure you've covered all the basics. Skinning isn't the most complex thing you'll ever come across, but it does rely on you having a good understanding of the things that come before it [smile]

hth
Jack

##### Share on other sites
Ok... I know where are the samples but I can't find nothing on what I want to do... I know i'm going fast but i learn fast and i'm working against the time :)