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 Professional Discussion / Can't make a decent limb process..

Author
Message
Alduce
21
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 25th Oct 2012 19:14 Edited at: 25th Oct 2012 19:19
Hi all,

I make 9 indipendent objects as an airplane parts.
Some of these objects are DB primitive objects and some are X objects.

obj 9000 ---> left wing
obj 9001 ---> right wing
obj 9002 ---> aircraft main body
obj 9003 ---> tail cone
etc etc


Ok when I finished to build my objects so I started to position them in right coordinates,right angles and right scale size to obtain a 3D airplane.
Ok, so If I start my program I can see an airplane made by my 9 indipendent objects.

Nothing in this plane is linked or limbed, is a 3d airplane made by 9 objects.

Now the troubles..
I try to make all my objects limbs linked to the "aircraft main body" object... (see attached pic!)
Here the steps :


1) I set my "aircraft main body" object (numb 9002) as MAIN AIRCRAFT OBJECT


2) I make a mesh for each objects (except "aircraft main body" obj)



3) I build my airplane limbs!
All my old and deleted objects has become mesh! (EXCEPT THE "aircraft main body" OBJECT!)


FINISH! I made all my old airplane parts become limbs linked to the "aircraft main body"!
So now I have my object number 9002 as my complete airplane!
BUT you can see the result of that process in the attached pic... some objects had lost their scale size too.. as well as thier coords and angles..

I tried to use a code like that:

but I got nothing...


Where I am in error??

Attachments

Login to view attachments
The Weeping Corpse
12
Years of Service
User Offline
Joined: 19th Sep 2011
Location: United Kingdom
Posted: 25th Oct 2012 19:34
I don't think MAKE MESH takes the model view matrix into account, so the output mesh resembles the constituent parts in their original
unrotated \ unscaled form.

But I've never used MAKE MESH so I could be talking out my #?*

Brendy boy
18
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 25th Oct 2012 20:00
Quote: "I don't think MAKE MESH takes the model world matrix into account,"

this

Quote: "Where I am in error??"

you have to offset each limb and rotate/scale them

Alduce
21
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 25th Oct 2012 20:11 Edited at: 25th Oct 2012 20:12
mmm I need to offset each limb and rotate/scale them...

So I need to use :


but what I need to put instead 0,0,0 ?? The original xyz position of the airplane parts?
I am in real confusion here..
Brendy boy
18
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 25th Oct 2012 20:36
Quote: "The original xyz position of the airplane parts?"

you can try

Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 26th Oct 2012 03:02
We have encountered this problem in our own projects and were able to solve the problem of
positioning limbs. If you could post your code we can provide you with an example to solve this.

[img][/img]


WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.
Alduce
21
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 26th Oct 2012 03:35 Edited at: 26th Oct 2012 03:37
Hello "Stab in the Dark software", yeah thank you, cause I am rolling and rolling but I can't assemble my airplane correctly.. here the code!:



At this point I get what you can see in the picture I previously attached.

I get all my aircraft parts joined to the "MAIN AIRCRAFT BODY" loosing all correct coordinates, angles and scale size

I avoid to use "Fix Object Pivot" command in this code.. If I using it or not the result is the same..
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 26th Oct 2012 04:02
Could you attach your ".x" objects so I don't have to create new objects.
Yes I saw your pic and I understand what is happening.

[img][/img]


WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 26th Oct 2012 04:07
Hi there.
As you commented, we have to make mesh from every object you want to add as limb, then when we add them, we have to offset every limb to the real x,y,z position of every object and last delet those objects.

for example, if we want to add 10 limbs to the our object:



We have to make sure how many limbs has the object that we load....so if our object has two limbs, the next to add will be limb three....so in the FOR NEXT, we have to increase a variable .

Cheers.

I'm not a grumpy grandpa
Mage
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Canada
Posted: 26th Oct 2012 04:20 Edited at: 26th Oct 2012 04:22
Why not use a system where you glue objects to limbs. You could then swap out parts easily to simulate upgrades, payload, and damage.

In game you could say an engine is out and replace that section with a ripped up and burnt version. Etc.

It's not all that efficient baking into the object during runtime meshes like missiles and things that detach from the aircraft. I think it's better to "glue" that stuff instead. Taking that approach further and gluing everything makes things every interesting.

If you don't have any intention of doing stuff like that then I'd recommend assembling the plane completely in a model editor. You can still use limbs and you would save yourself some trouble.

Alduce
21
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 26th Oct 2012 10:55 Edited at: 26th Oct 2012 10:56
@Stab in the Dark software:
Hi dude and thxs for your help! here attached the X objects!

@chafari:
Now I am using a PC without DBPro but your code seems pretty good the reach my goal! Later I will try for sure!

@Mage
Interesting! and I think about some of the features you talking about! Some tests soon about!

PS: THANK YOU GUYS!

Attachments

Login to view attachments
Alduce
21
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 26th Oct 2012 12:29
DONE Dudes!
chafari your code work great!



Stab in the Dark software please stop to make code and REALLY thank you!

Thank you all!

Login to post a reply

Server time is: 2024-04-19 21:12:46
Your offset time is: 2024-04-19 21:12:46