Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Attaching Limbs to each other

Author
Message
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 24th Jun 2010 10:48
Alright, brief synopsis of what is happening. Part of the game I am working on is an armor customization system where you can attach weapons/tools to pieces of armor. Each armor piece has specific spots where you can place the mod and those spots are saved in the model as a limb. When you add a mod, I want it to display it and position it over the plain that is the attach spot (so it looks like it is physically attached).

Things I have tried thus far:
Limb Position X()-Seems to only be returning 0 (which is the location of the parent object)

Limb Offset X()-Also returns 0 primarily because it isn't offset.

The only way I can think of to do it would be to save the object and another text file that gives offset values for each mod slot. This would get cumbersome because (ideally) some parts will have up to 5 slots and I would have to locate each spot manually (can't think of any other way than by guess and check).

Thanks!

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 25th Jun 2010 12:16
Ok, if I'm reading this right then you are creating new limbs for the armour pieces (i.e "Add limb")?

If that is the case, then the new limb (the armour mod) will be free-floating, with no place in the hierarchy (hence it is equivalent to the object's limb 1, usually located at offset (0,0,0)). You want to try Link Limb, to make the new armour mod a child limb of your attachment point.

So, if I wanted to add (say) an emblem as a custom part of the shield, I would add the emblem as a limb of the shield object, then Link the limb so that it was a child of the shield object. At this point, I could offset the limb to put it to any position relative to the shield's location.

Hope this helps!

"I wish I was a spaceman, the fastest guy alive. I'd fly you round the universe, in Fireball XL5..."
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 25th Jun 2010 21:23
Let me clarify.

I have that much, I can add the new limb and Link it to the limb that its supposed to be attached to. The attachment point limb is part of the model. I want to take the limb I add and place it right on top of the attachment point. Because not many of the armor points will have exactly the same locations of the attachment points, I am trying to find a way to get the location from the model itself. my hope was I could just check the offset values of the attachment point, but since it was made as part of the model, it seems to have offsets of 0. My backup was to check the real world position of the limbs, but again, they are the objects location.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 26th Jun 2010 20:32
@bn2
It comes down to pivot points and how the 3d app that made the model exports limbs in relation to the limb hierarchy. It can also depend on how the user built the model in the 3d app. If they didn't set the pivots correctly or didn't link a hierarchy at all, the limbs could be all based on 0,0,0 instead of relative to their connection to a parent limb.

If your game or app uses it's own models, then you can control this. If you are building the models yourself, you can make sure the limbs are linked correctly in your 3d app before export. If that doesn't make a difference, then save each limb as it's own object with it's correct pivot point set.

Usually setting the pivot point of an individual object is as simple as positioning it so that the area on the mesh you want to be the pivot is located at 0,0,0 before you save it. For example, a lower leg mesh would be placed so that the knee area or slightly above is located at 0,0,0. Then you save that object.

Once in DBC, build your model by loading in the individual limbs, making meshes from the objects, adding the limbs and then linking them according to Robert the Robots instructions above. You would then offset them (AFTER they have been linked) relative to the parent limb they were linked to.

Now, once your model is completely built, you can do a couple of different things:

1. Glue your additional objects to the limb they belong to and offset these objects by using POSITION OBJECT <addon object>,x,y,z where x,y and z is an offset, not an absoulte world position.

2. Create a triangle object where all of the vertices are the same, then make a mesh out of it. This should create an invisible mesh that has only 1 point. Use this new mesh to add additional limbs to your object. Link and offset these limbs to the positions your addons will be placed.

2a. Glue your addons to the hidden limbs
OR
2b. Make a mesh out of your addon and use CHANGE MESH to change the invisible limb to your addon mesh. The only problem with this is you'll have to change the mesh back to the invisible mesh when the addon is removed. This can have the benefit of reducing object polygon counts when you remove addons.
OR
2c. Using LIMB POSITION X() Y() and Z() to position your addons at the invisible limbs.

If you built your model with the same hierarchy as was from your original full model from the 3d app, in DBC you can save the full model's animation and apply it to the pieced together model.

If rebuilding the model isn't an option, then you can use your own dummy limbs to place at the rotation points (pivot points) of your main model (of course with the proper links and offsets). You essentially build a pseudo skeleton of your main model out of plains or something and you rotate the skeleton limbs according to the model's animation. You then use the limb positions to place your addons similarly to 1 and 2 above.

There are many options really. The best situation would be to start with a model that has the correct offsets and pivot points set. If they are set correctly initially, you will get return values when you use LIMB OFFSET X() y() z() or LIMB POSITION X() Y() Z().

Enjoy your day.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 4th Jul 2010 22:16
Hows this going?

Enjoy your day.
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 4th Jul 2010 22:47
Sorry I have't gotten back on this one, things have been pretty crazy in a "I haven't had a lot of time to sit down" sorta way. I am not familiar with setting up the model correctly in 3ds max, so I have been trying to figure out how to preserve the offsets. If you know/have an idea, it would be greatly appreciated.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 9th Jul 2010 02:52
I've never used 3ds max so I have no idea. However, if you create you limbs as separate objects (which you would have to do to use animation in DBC) if you position the point of rotation at (0,0,0) - for example positioning the upper arm object so that the elbow is at (0,0,0) - then upon saving these individual objects, their pivots will be in the correct places.

I would guess that there is a way to build a hierarchical model using these limbs making parent/child relationships in 3ds max. Look for any information that talks about hierarchical animation. The goal is for them to keep their rotation points, but to be positioned relative to the main parent.

In Blender, you can set the pivot point directly for a limb. Once that is set, you move it to the correct position on the model. Then, you have to commit the rotations to the limb before it is attached as a child limb. What I mean is, if I wanted to create a humanoid model in a "T" pose, I might have to move and rotate the upper arm so that it is pointing sideways from the chest at shoulder height. In Blender, the upper arm object will have rotations recorded that got it to this orientation. What I would have to do is apply these rotations, or set them so that this becomes the natural position of the limb. After this process, the rotations for the limb now read 0 - but the limb is oriented how I want. Now I can make it a child to it's parent (the chest in this case).

There may be a similar setup process in 3ds max, I don't now the settings or the language to describe it though.

Enjoy your day.
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 10th Jul 2010 22:42
Perfect! Thanks for the help latch! Turns out all I had to do was set the pivot point of the mod slot objects to the center of themselves. I had created them (probably should have mentioned this but didn't think was relevant) by making a prism and then detaching a face from the main object. As a result it maintained its pivot point at 0,0,0 along with the rest of the object. Found an object in the hierarchy area to change the location of the pivot point.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose

Login to post a reply

Server time is: 2024-04-24 06:28:12
Your offset time is: 2024-04-24 06:28:12