Something that has always bugged me

Started by
6 comments, last by PaulCesar 19 years, 10 months ago
Ok, I could never figure out what this is, but a recent post (which I didnt feel like hijacking) I believe hit on the term. That would be an entity or charactor factory. When I create, say 2 models, what are some ways of which I can attach them together at runtime? This would be easy if the models would be static, but they wouldent be (well, 1 would probably be). I was thinking perhaps it was NECESSARY to have skel. animation for this effect, and SOMEHOW you miraculously attached some sort of megnetic part of each object together (like vertex to vertex with something like a direction normal?) I have no idea, im no 3d developer. If someone could solve this for me (or give me a tutorial or something that I could understand the concepts, it would make me feel better. Not that im really working on it for a nearby project, just that... well... its been bugging me for quite a few years, LOL. Thanks, Richard
Advertisement
One option which worked for my small tank test (with rotating barrel) is to have an extra triangle at the point where the two parts will connect. This triangle should be a rightangled one (one of the corners should be 90 deg), and one of the side should be significantly longer than the other. Point this longer side forward, and the shorter side left or right (whichever you wish).

In the second modelpart (the head for instance) model the part relative to the position of that triangle.

Then in game, load the models, find the triangle in the base model, determine is position and orientation, and move the second model part to that position and orientation. And that''s it.

Search the net for how Quake 3 models are built up, they use the same system. The small triangles are called ''tags'' there.
how would you mark that triangle? (In the modeler)
Just "bind" point to bone, then translate that point by bone, it''s attached to and you get your sub-models position.
I think in most modellers you can give each part of the mesh a seperate name. In this case, name the triangle name_tag, and export is with the base mesh.

[edited by - rick_appleton on June 3, 2004 6:02:22 PM]
In 3DStudio Max there''s a thing called a ''dummy'' which is basically a named transform with no geometry attached. That''s often used for marking an attachment point on a model. The benefit of a transform rather than a triangle as suggested here is that you get an orientation (and scaling) as well as a translation. It also seems cleaner as you don''t have a redundant triangle just for marking a position.

Game Programming Blog: www.mattnewport.com/blog

We''re using the dummy analogy in our engine. A dummy is a named but invisible object (with all object properties such as a transform), that has a position in the scenegraph like any other mesh object. On attach, you can either directly attach to the dummy transform matrix (if you have the node of the object in the graph). Or search through the scenegraph for the named dummy (probably using some sort of hash key), and attach once you found the node.
Sorry for not responding sooner, that clears a great deal up. Im bookmarking this for future referance (when I get back to a project that will need this).

This topic is closed to new replies.

Advertisement