|
From: | Cyril 'Hulud' Corvazier |
Subject: | Re: [Nel] multipart meshes, deforming, adding |
Date: | Fri, 19 Mar 2004 17:48:11 +0100 |
Hi Andi,
In NeL, you can bind several meshes on the same
skeleton.
Export some body shapes (upper_body00.shape,
arms00.shape, head00.shape, legs00.shape etc..) create a skeleton instance,
create an instance for each part of the body and bind them to the skeleton
:
USkeleton *skel;
std::vector<UInstance*> instances;
... // Load skeleton and shapes
uint i;
for (i=0; i<instances.size(); i++)
{
// Attach each shape to the
skeleton
skel->bindSkin(
instances[i]);
}
If you want to deform the body, play with the
bone's scale factor :
UBone *bone;
bone->setScale(CVector
(0.75,0.75,0.75));
All your objets will be affected by the
deformation.
If you want to change the general size of your
character, change the scale of the skeleton :
USkeleton *skel;
skel->setScale(CVector
(0.75,0.75,0.75));
All your objets will be affected by the deformation too.
If you have weapons, export them in seprated shapes (gun00.shape etc..) and
stick them to a bone you have prepared in the skeleton. Here, my bone is called
"right_hand_stick_box".
// Stick the current gun in the right hand
uint rightHandStickBox = skel->getBoneIdByName
("right_hand_stick_box");
skel->stickObject(gunInstance, rightHandStickBox);
To swap a body part, just detach the old instance from the skeleton and
bind the new one.
skel->detachSkeletonSon (instanceToRemove);
skel->bindSkin (instanceToAdd);
To have perfect body part connection, the boundary vertices in the
different part must have the same position and the same skinning weight. Also,
we recommand that your different body part meshes use the same pivot point in
3dsmax.
Keep in mind you willl have better performances if you :
- minimize the number of shape used per character
- minimize the number of material used per shape - minimize the number
of bones used per shape- minimize the number of vertices discontinuity (normal, UV and position
discontinuity) into your mesh.
The other questions regarding CLOD and MRM will be answered by Lionel
later.
I wish you a hacky weekend Andy :-)
Hld.
|
[Prev in Thread] | Current Thread | [Next in Thread] |