The 'Stencil shadow' thread

Blitz3D Forums/Blitz3D Programming/The 'Stencil shadow' thread

@Devils Child: I'll be on Irc at 7pm GMT if you wanna catch up on this stuff ok :)

but all my other models are doing strange things!


I've had problems with skinned meshes too. This is what I think is the cause.

To get a transformed vert from a skinned mesh, I store all vertices positions in the local space of the bone which has major influence on them. I'm discarding blended weighting for now in the hope it speeds things up a bit.

Bones in a mesh have a 'rest pose'. You must do the above routine when the bones are in this rest pose, else their recorded local bone offset will be wrong, which will cause your TFormB3DVertex() function (or DLL or whatever method you're using) to return bad values.

When creating a skinned mesh, record the rest pose at frame 0, this seems to work ok for me.

You can just see the errors this causes on this robot2.b3d mesh, look closely at the gun/hands and the antenna, there's what looks like ghost geometry. This mesh has no keyed rest pose at frame 0!

In fact, as a quick test, load 2 versions of your mesh, one using LoadMesh() and the other using LoadAnimMesh()

If they don't look exactly the same... you're going to have problems.