Skinning a mesh.... need help

Started by
12 comments, last by Grattier 18 years, 3 months ago
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
Advertisement
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
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?
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.
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...
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
..also look into vertex tweening
Look up "morph targets". That is an animation technique that transforms one shape into another, such as a cylinder into a log.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
Ok thanks a lot guys.. i'll take a look to all those stuffs and come back give you my feedback

a+

This topic is closed to new replies.

Advertisement