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 / How can you get limb locations relative to the world? Also Glued object bug.

Author
Message
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 3rd Aug 2011 19:20
My tank program with a rotating turret loses all of its limb locations in the turret. I tried gluing objects to the limbs, and the glued objects also lost their locations to the world. So how can you get the locations of rotated limbs, or how can you get the locations of glued objects?

Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 3rd Aug 2011 19:28
Strange one, limb position x y z never let me down. Is the tank already animated? - I mean, is it rigged and linked, with the limb pivots set?

I'd be happy to take a look if you want to send me the model.

Health, Ammo, and bacon and eggs!
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 3rd Aug 2011 19:52 Edited at: 3rd Aug 2011 19:57
How do you want the model..

3ds
x
dbo
obj

It's not animated, I rotate the limbs manually.
I put limbs in the turret for turret direction. The limbs work, but always relative to the tank. I glued objects to them, the X Z positions are always the same, no matter where I move the tank. If I rotate the turret with..



The limbs rotate fine, but their positions return results that are not rotated. In fact all of the limbs return the same numbers, and they are not near to each other.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 3rd Aug 2011 20:11
Quote: "The limbs rotate fine, but their positions return results that are not rotated"


Time ago I had the same problem...I couldn't get the limbs angles or position, and the problem was that the object was extremly small to make darkbasic give reliable values. Could you post your object ? any format you want.

Cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 3rd Aug 2011 20:19
Here is a 3DS version...

Max P
16
Years of Service
User Offline
Joined: 23rd Jan 2010
Location:
Posted: 3rd Aug 2011 20:28 Edited at: 3rd Aug 2011 20:30
You should use limb direction instead of limb angle.
It will give the right angles
edit nevermind, read you post too fast.
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 3rd Aug 2011 20:32 Edited at: 3rd Aug 2011 20:33
I have checked you object and I think the problem you have, is that you must link your object limbs in your 3D program, o manually in Dbpro.

Cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 3rd Aug 2011 20:32 Edited at: 3rd Aug 2011 20:34
Here's an image. I want to send an SC_Raycast from box1 to box2 to pick up the mines in the minefield. This example uses glued objects, but I have tried limbs as well.



DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 3rd Aug 2011 22:43
I tried your model but as it is 3ds it will not load into DB Pro to try. I made a quick object myself and did a test for the limbs to see if I could get the same result.

It could be a scale issue, at least that is what I can gather from this little test. At first my object and limb positions were the same. Increase the scale and they begin to change. Hopefully scaling up the object will correct your problem. Chafari, I have just noticed, already mentioned this, so we are probably on the right lines.

http://s6.bitefight.org/c.php?uid=103081
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 3rd Aug 2011 22:49
I've nearly got it working by manually linking meshes to limb 0, and then offset them. But this creates a new problem that the new limb rotates around its own axis instead of with the barrel of the gun. The SC_Raycast works, but only in line with the tank, and not with the gun barrel.

So now what I need is a way to rotate the new limb with the gun barrel.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 3rd Aug 2011 23:01 Edited at: 3rd Aug 2011 23:06
Quote: " Chafari, I have just noticed, already mentioned this, so we are probably on the right lines."


We should make some test, but I think we are on the right way. When we scale the object darkbasic runs different


@Pincho Paxton
When we link limbs one to each other , Darkbasic changes the order of the limbs. We have to make sure which is which.

Cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 3rd Aug 2011 23:13 Edited at: 3rd Aug 2011 23:14
Quote: "@Pincho Paxton
When we link limbs one to each other , Darkbasic changes the order of the limbs. We have to make sure which is which.

Cheers."


I am rotating the right limb, but it is just spinning on the spot, and not relative to the root limb.

I think my tank is big anyway, an offset of X+100 is just the barrel length.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 3rd Aug 2011 23:32
I had a look in 3DMax, and realized that all limb of your tank where in the same place 0,0,0. I have asigned new limb center to all limbs, but in Darkbasic we have to link them again...

I think a good solution, just add a hiden object that rotate same limb angle as the turret and place it in same coord of the tank and make all checking with this hidden object.

For some reason , as you said ..your object is a mess ...the code is so easy:




Cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 3rd Aug 2011 23:44
OK, so I scaled the whole lot up by 1000, and the limb positions are still identical...




Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 3rd Aug 2011 23:48
Quote: "I had a look in 3DMax, and realized that all limb of your tank where in the same place 0,0,0. I have asigned new limb center to all limbs, but in Darkbasic we have to link them again...

I think a good solution, just add a hiden object that rotate same limb angle as the turret and place it in same coord of the tank and make all checking with this hidden object.

For some reason , as you said ..your object is a mess ...the code is so easy:"


All of my limbs are at 0,0,0 ? Oh. Then why is one at the end of the barrel? I am confused???

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 3rd Aug 2011 23:55
Quote: "All of my limbs are at 0,0,0 ? Oh. Then why is one at the end of the barrel? I am confused???"


The center of each object in 3D, is not the center of 3D in darkbasic. The object has it center defined by the 3D program we export. If we export an object out of the 0,0,0 in 3DMax, when we rotate it in Darkbasic pro, it will not rotate correctly.

I made an example with simple boxes and works perfect ...download to check

Cheers.

I'm not a grumpy grandpa
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 3rd Aug 2011 23:58
Here's a fixed model with some test code. I set the pivots etc and now the limb position stuff works fine.

Health, Ammo, and bacon and eggs!
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 4th Aug 2011 00:03
Quote: "The center of each object in 3D, is not the center of 3D in darkbasic. The object has it center defined by the 3D program we export. If we export an object out of the 0,0,0 in 3DMax, when we rotate it in Darkbasic pro, it will not rotate correctly.

I made an example with simple boxes and works perfect ...download to check

Cheers."


Thanks!

Quote: "Here's a fixed model with some test code. I set the pivots etc and now the limb position stuff works fine."


Thanks!

Something might be screwed up in Anim8or. I think years ago I fixed a model by removing an extra root limb, that might be the problem again.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 4th Aug 2011 00:05
Wow Van B that's great !! really good work

@Pincho Paxton
When I reffered to object center, I meant object pivot. An object can have the pivot 20 unit away and when rotate doesn't where it is but where the pivot is.


Cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 4th Aug 2011 00:55
Quote: "Wow Van B that's great !! really good work

@Pincho Paxton
When I reffered to object center, I meant object pivot. An object can have the pivot 20 unit away and when rotate doesn't where it is but where the pivot is.


Cheers."


Ok thanks, I don't know where the pivot is in Anim8or. Anyway it works now!

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 4th Aug 2011 01:23
Found out how to move the pivot points in Anim8or now, not exactly sure where to put them, but this is how you move them....

http://en.wikibooks.org/wiki/Anim8or_-_Basics_to_Advanced/User_Interface_Overview/Object_Edit

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 4th Aug 2011 13:04
I had a look to this link, and this free program is ok for little projects. In Anim8or , when we hierarchically join child to parent ...the child object will lose its pivot. That's why I told you all your limb had the pivo in 0,0,0.

In commercial 3D programs every limb will keep its pivot in oder be rotate correctly although being hierarchically linked.

Quote: "Anim8or Lastly, keep in mind that, for example, a toe might have its own axis/pivot -- but once you JOIN SOLIDS and attach the toe to the foot -- you are now dealing with the pivot/axis of the foot. The toe has been absorbed by the foot as far as pivot/axis is concerned."


I'm glad that it works now

Cheers.

I'm not a grumpy grandpa
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 4th Aug 2011 13:30
I'm glad I have 3DSMax, it's great for hierarchy models - I tend to model in Rhino3D then weld, smooth, rig and animate in 3DSMax. In that, it's just a case of selecting a limb then setting the pivot to center on the limb, then offset it if needed.

Cool looking tank BTW!

Health, Ammo, and bacon and eggs!
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 4th Aug 2011 15:49
Trying to find out more about Anim8or, a free program, in order to try adjust pivot, I try to download and install it. WoaAGG!! BLUE SCREEN !! virus. I had to reset my PC and Anim8or wasn't installed, but I realized that on botton right of the screen something like a small TV set.I came into control panel and saw same ico-program and try to uninstall no way !! .I try to find information on google about this click potato and it was a malware. Trying to solution my problem, I saw many incoherent nonsense solution. I also found many miraculous programs but we need pay for them.

Finally, I found a program that claimed to remove it, and free. I intall Malwerebytes anti-malware. It was even worse, because it blocked the screen as the computer reset.

I had to restart my computer in Safe-mode and anistall the fk program .

To not bore anyone with this, I tried in control panel and try to uninstall from there again and when the antivirus asked me to quarantine it or run ,I ran the risk of running the a pop up menu say " you have to restart your computer " and finally it works


I'm so tired and sweaty that I need a couple of beers.

Cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 4th Aug 2011 17:37
Thanks for the additional help, and comments. Anim8or usually doesn't install, it is a stand alone exe, and you just put it anywhere on your computer. I think that the pivots can be made to work somehow.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 4th Aug 2011 18:09
Quote: "I think that the pivots can be made to work somehow."


Yes we can...I have done it. I have linked and offset limbs and save model to dbo (five minutes)


Cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 10th Aug 2011 04:02
Thanks for all of the help. I have put a video up now in WIP...


http://forum.thegamecreators.com/?m=forum_view&t=187908&b=8

Login to post a reply

Server time is: 2026-07-11 07:05:45
Your offset time is: 2026-07-11 07:05:45