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.

Newcomers DBPro Corner / Is it possible to manipulating object hierarchy

Author
Message
OnQue Int
17
Years of Service
User Offline
Joined: 8th Jun 2007
Location:
Posted: 11th Dec 2008 17:14 Edited at: 11th Dec 2008 17:20
If i Create an object in 3d Studio max ,blender or what ever and it consist of many pieces and i name each peice in 3d studio max or whatever can i manipulate each piece in DBP

example

1. I create a builing with a ladder. does the later have to be seperate to code that object so i can go up or can i go into the hierarchy of the object and code the ladder.. in 3dstudio max i can name each peice then export selected which keeps the object in seperate pieces but its still a whole and one object in DBP

2. and if so when exploding a wood building made of block for 2x4
would it be best to try to animate the explosion of the wood debre flying throgh the air. or should i go into the hierarchy of the building and creat a code to randomly throw the blocks to give the effect

3. then if i wanted to blow a peice of a model (like an arm of of a charater) when i shoot him would i create the arms of the charater in 3ds seperate use a contraint to hold them on and be animated. then when i shoot his arm go into the hierarchy remove and throw his arm and of course the model would have had his arm that is part of his body messed up so when you detach the arm it will give the effect of it being shot off.

These are very important and i really cannot continue till i have an understanding of this. Any ideas?
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 11th Dec 2008 18:22
1 & 3 are a definite yes (although for 3, I'd hide the undamaged limb and unhide the damaged one, rather than simply remove the limb).

2 I don't know about - you'd probably be able to do something with the physics plug-in (I've see the destructible log demo), but that's beyond my experience.

OnQue Int
17
Years of Service
User Offline
Joined: 8th Jun 2007
Location:
Posted: 11th Dec 2008 19:49
How is it possible to go in to a hierarchy..What would the code look like?,, how would i define the object in DBP to do this
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 11th Dec 2008 23:52 Edited at: 11th Dec 2008 23:52
Ask the easy ones, why don't you?

Ok, I can't help you with the modelling itself - I have almost no modelling ability at all. You're on your own there.

One thing I have worked on though is making things a lot easier to do or to get at, and one of those things is the creation and manipulation of objects and limbs. You'll find all sorts of commands in my plug-ins that, with a little experience, will make things easier.

You'll need to install my plug-ins (link in my signature) to compile and run this code:


Run the code first and see how it builds up a hierarchy of limbs into a new object.

Notice how it sets up a name for each limb, and associates various limbs with a another limb as a parent - it basically builds up a tree structure. You are responsible for setting up an equivalent structure in the same way in your modelling package and naming the 'interesting' limbs, ie the ones you want to manipulate.

Next, take a look at the main loop, in particular lines 103 & 104. You'll see that I'm not using a limb number, but instead telling DBPro to find a limb using a name instead (using another of my functions). That's how I advise you to do it. That way, when your limb numbering changes because you modified your object, you don't need to go back through your code to correct those limb numbers.

The last thing is that each limb can have a parent and several children. Those children are related to each other as siblings. I have provided 3 functions that allow you to query the parent, first child and first sibling of each limb. I use those functions in the last 2 functions within the code to display the indented text description of the limb structure. Each of those functions will return -1 if there is no parent/child/sibling for the specified limb.

For example, you may have limb 0 as the top level limb, and limbs 1 and 2 have it set as a parent. You should expect to see the following relationships between them:
- Limb 0 - No parent, no sibling, child is limb 1
- Limb 1 - Parent is limb 0, Sibling is limb 2, no child
- Limb 2 - Parent is limb 0, no sibling, no child

Now there's a lot of code there that you might have a problem understanding - just stick to the bits I've pointed out and you'll be Ok, until you are ready for the rest.

OnQue Int
17
Years of Service
User Offline
Joined: 8th Jun 2007
Location:
Posted: 12th Dec 2008 06:19
Not to change the forum subject but how do you do explosions with nvidia fx composer? or do you know where i couldget the shaders
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Dec 2008 14:28
Quote: "how do you do explosions with nvidia fx composer?"

No idea.

Quote: "or do you know where i couldget the shaders "

No idea. Remember though, that shaders do NOT affect the mesh - they affect the appearance of the the mesh and only when active.

OnQue Int
17
Years of Service
User Offline
Joined: 8th Jun 2007
Location:
Posted: 12th Dec 2008 16:11
Yea i understand that. I use it for water which is nice. I see fire but no explosion and I seen a tut you did on the composer for making it darkbasic ready back in 2005 so i thought mabey you may know where i could find some or mabey do you know of a way I can create an exploding barrel. I'v searched the forum but of no luck
I see where there are a image with 16 parts of an explosionmad eby a genorator. Dont know how i could do it and make it beleiveable.. I thought textureing 16 planes position them in the same place witha timer to show one for a second hide and show the next one but is there a better way.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Dec 2008 18:11
Quote: "and I seen a tut you did on the composer"

Me? Write a tutorial? I don't think I have ever written one beyond the networking one for my own networking plug-in.

You must be thinking of someone else.

OnQue Int
17
Years of Service
User Offline
Joined: 8th Jun 2007
Location:
Posted: 12th Dec 2008 21:06
Im sorry it was IAN T
heres the thread
http://forum.thegamecreators.com/?m=forum_view&t=49137&b=1 if you have ever run into him have some effects questions for him

Anyways I see the code on the heirarchy would i be able to do this with an already made object from a graphics editor..just trying to be clear with this concept
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Dec 2008 21:27
Depending on your editor, yes. I don't model, so as I said earlier, you'll either need to experiment, or ask someone else how to do that.

Login to post a reply

Server time is: 2024-09-27 22:29:28
Your offset time is: 2024-09-27 22:29:28