You may be aware of this news, but just in case, I want to mention that two great new samples are now available on the site of XNA Creators Club:
Now, what’s great about them? Glad you’ve asked.
(I) Skinned Model Extension Sample
The first sample shows you how to extend the original Skinned Model sample so that:
- You can “move” a part of a skinned model independently of an animation sequence (like in this case, the arm and or head),
- You can position objects relative to a specific bone (in this case, a bat), and
- You can properly attach bounding geometry to the animated model (in this case, spheres).
The code is a great source of technical knowledge regarding the skinning technique for programmers but, thanks to some minor glitches in the skinned model, they can also learn how cumbersome and picky are the processes of (not only modeling and unwrapping but) rigging, skinning and animating a 3D model, so that it looks ok in each and every (expected) situation before going gold.
As you can see here, when you move the head one of the vertices remains (almost) still, which means that either it wasn’t attached to the neck's bone at all or, if it was, then its “weights” should be readjusted.
It seems that the part of the belt marked above in orange moves along with the hip whilst the rest of the belt moves with the torso. And so, the walking animation, even if it may behave as expected, looks kinda weird.
This is likely not relevant for programmers -being the programming part the only/main purpose of the sample itself, but for indies like me that tend to develop all parts of a game “in solo mode”, its a fabulous example of some of the headaches they are going to deal with on the artistic side of things.
(II) Primitives 3D Sample
The second one presents the set of classes you will need to create a cube, a sphere, a cylinder, a torus and the famous teapot!
These primitives are usually found in most famous modeling apps, among others, like 3D Studio Max or Maya.
You may wonder: why the teapot is considered a primitive? Well, thanks to the type of powerful operations used to create it, procedurally: bezier-curve calculation! Nice one, indeed …
One suggestion for the cylinder:
In case some of you want to create the triangles that conform each cap of the cylinder so that they lay out uniformly around a centered vertex, instead of towards one side -as shown above, then you’ll have to replace the following method in the “CylinderPrimitive” class:
So that, instead, it looks similar to:
Being the result:
This isn’t critical at all, but for the sake of (better) unwrapping -and even of creating more “sections” (rings) on each cap, programmatically- 2 centered vertices and a few more triangles come in handy without hurting performance.
> Link to Spanish version.