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 / sticking objects together

Author
Message
alanuk
22
Years of Service
User Offline
Joined: 25th Mar 2003
Location: United Kingdom
Posted: 12th May 2003 19:10
I have a large object and a couple of small objects. I need to glue the small objects to the large one so that when the large object moves in any direction the smaller ones follow.

I looked at limbs which I don't fully understand. But I get in a mess when I add limbs as they appear miles away as duplicates of the smaller objects. (Hopefully the DB book will help out when it arrives)

Any ideas please?

Alan
Coder Bob
22
Years of Service
User Offline
Joined: 1st Apr 2003
Location: United Kingdom
Posted: 12th May 2003 19:41
This is a little example i threw together for some one a couple of weeks ago. I hope it helps. oh and Are you scaling your large object if so this kind of messes up the limb positioning thing try using really small offsets. Any questions mail me.

Gaz

alanuk
22
Years of Service
User Offline
Joined: 25th Mar 2003
Location: United Kingdom
Posted: 12th May 2003 22:06
Gaz, many thanks for that. I've saved the code and will try it later.

Alan
arras
22
Years of Service
User Offline
Joined: 3rd Feb 2003
Location: Slovakia
Posted: 13th May 2003 11:31
You eighter use glue object command or add object limb command. For second one you have to make meshes from small objects firsth.

You can alter position of smaller objects by move, position and rotate comands in firsth case, offset and rotate limb commands in second case.

Remember to place your small object at coords 0,0 before making mesh from it, because coordinate 0,0 will be origin point of mesh and later limb you will create out of it.

You can load small objects directly like mesh not object.

Look DB help -MAIN COMMANDS MENU-BASIC3D- for info.
alanuk
22
Years of Service
User Offline
Joined: 25th Mar 2003
Location: United Kingdom
Posted: 13th May 2003 21:09
Gaz, I ran your code which works very well. But I still can't get mine to work. It keeps telling me that the limb already exists, which it doesn't cos' I haven't made any others.

Here is a snippet from the program that is relevant.

If you can spot the error, I will put you in my will !!
I've been at this for a couple of days now.

Alan
==================================================

load object "cylinder9.3ds",1
texture object 1,2
scale object 1,500,500,500
set object texture 1,1,0
position object 1,1000,80,1500

` load door trims
load object "trim1.x",35
scale object 35,10,13,15
texture object 35,44
yrotate object 35,350
position object 35,680,15,1445

make mesh from object 22,1
add limb 35,1,22
glue object to limb 35,1,1

========================================================
Coder Bob
22
Years of Service
User Offline
Joined: 1st Apr 2003
Location: United Kingdom
Posted: 14th May 2003 04:43
Ok alan looks like you added the limb to object 35 then tried to glue object 35 to limb 1 on object one which doesnt exist. try this...

make mesh from object 22,1
add limb 1,1,22
glue object to limb 35,1,1

or if you want object 1 glued to object 35...

make mesh from object 22,1
add limb 35,1,22
glue object to limb 1,35,1

think thats right but i didnt test it, hope it helps and thats Gaz with a Z (for the will)

Gaz

alanuk
22
Years of Service
User Offline
Joined: 25th Mar 2003
Location: United Kingdom
Posted: 14th May 2003 21:08
Gaz

I tried your code but it came up with the same errors, ie 'limb already exists'. I thought, it can't be right, I haven't made any yet. So I incremented the limb number until the error stopped. I got to 34. That is the object nuber I am using. As I used CShop2 to make the objects, I can only think that they have limbs attached or something. Any way the code looks like this, but I don't know why it works, but it does !!

load object "trim1.x",35
scale object 35,10,13,15
texture object 35,44
yrotate object 35,350

load object "trim1.x",36
scale object 36,10,13,15
texture object 36,44
yrotate object 36,350

make mesh from object 22,1
add limb 1,37,22
glue object to limb 35,1,1
scale limb 35,1,20,20,20
offset limb 35,1,-650,-100,0

make mesh from object 23,1
add limb 1,38,23
glue object to limb 36,1,1
scale limb 36,1,20,21,20
offset limb 36,1,430,-110,0


Thanks for your help. Hope this is of help to others too.

The bloomin' DB book still hasn't arrived yet.

Alan

Login to post a reply

Server time is: 2025-05-16 23:18:48
Your offset time is: 2025-05-16 23:18:48