About Store Forum Documentation Contact



Post Reply 
Create simple skeleton
Author Message
AndrewBGS Offline
Member

Post: #1
Create simple skeleton
Is this feature available in 2.0? If not, can you count this as a feature request?

Basically I need slots on some static items so I can place other items on them on demand (like a slot to place fire on a torch for example, or slots on a tree to place apples on them). Apparently this can't work with just the slots, I need a skeleton.

I have pretty much no idea how to use any 3d modeling software so i just want a random bone somewhere so my object can make use of its slots.

Can this be done in esenthel?
03-13-2014 08:36 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Create simple skeleton
You can create slots when there's no skeleton, it will be created for you.
03-13-2014 08:38 AM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #3
RE: Create simple skeleton
Yes, I noticed; But I can't seem to use those slots;

When I try to attach objects to them, the objects are placed at world coordinates (0,0,0) instead of the place the slot is on the object.

Maybe I'm just using it wrong? I need a cskel to determine the slot, so i use this:

CSkeleton cskel; cskel.create(mesh->skeleton());
if(C OrientP *point=cskel.findPoint(8"slot1")) ....

This always gets me (0,0,0). So is there another way I should find the slot without a skeleton? I picked this up from the tutorials, but there the character had bones.
03-13-2014 10:09 AM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #4
RE: Create simple skeleton
If I remember correctly, you put the object at slot * matrix. The slot is in local object space, so you transform it by the object matrix to get the correct position.
03-13-2014 02:23 PM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #5
RE: Create simple skeleton
Can you please provide me some code as to what exactly you mean? I don't quite understand, I'm sorry.
03-13-2014 08:30 PM
Find all posts by this user Quote this message in a reply
xzessmedia Offline
Member

Post: #6
RE: Create simple skeleton
i subclassed game.obj and made my own obj which these are part of
Code:
Vec GameObject::GetMeshSlotVec(cchar8 *name)
{
  
   return CorrectSlotPosition(matrix(),mesh->skeleton()->getPoint(name).pos);
}

Vec GameObject::CorrectSlotPosition(Matrix m,Vec slotpos)
{
   Vec    ofs=Cam.matrix.z*(D.particlesSoft() ? 0 : -0.1);
   return slotpos*m+ofs;
}

the code is from any of the provided source/tutorials
03-14-2014 10:28 AM
Find all posts by this user Quote this message in a reply
Post Reply