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 I do this with limbs commands (or others) ?

Author
Message
Hell_666
17
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 22nd Jul 2010 17:28 Edited at: 22nd Jul 2010 17:30
Hi, I would like move an object on a axis but the object is glued at an other object, and I don't want they to unglue them.

For example this a sphere (the object that must be move on the axis), and a box :




Thanks to all

Eternal suffering ...

I'm french
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 22nd Jul 2010 17:35
There is a limb command for setting the offset of a limb.... I think it's called limb offset or something like that. I've never used it, but you may be able to adjust the offset of the sphere while attached to the bar and thereby make it move along the axis of the bar. If this works, it will move along the bar in the same way no matter which direction the bar is facing..... I hope my memory serves me correctly since I am not at my PC right now and have no DBP help files.

The fastest code is the code never written.
Hell_666
17
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 22nd Jul 2010 17:43
Yes, it's "offset limb", but my sphere doesn't move when I increase the position values of the offset

Eternal suffering ...

I'm french
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 22nd Jul 2010 18:05
That's odd. The name would suggest that it does.
Well, there is another method, don't attach it directly. Orient the sphere to the bar both location and facing each frame. Make your offset manually first. For instance, your bar is 10 units long and you want the ball to move the entire distance. The center of the bar should be the same as the pivot of the bar. So, position the ball at the same location as the bar and point it to the bar's point-at orientation. Move the ball left/right on a timer.

The fastest code is the code never written.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 22nd Jul 2010 18:07
Can you post the code your using?

I'm puzzled as to why that won't work, there's no reason why you shouldn't be able to offset a limb and move the object attached to it.

One option would be to have 2 limbs, one at each end of the axis, then interpolate the sphere position between them. This would involve using a non-glued object and positioning it each loop. But I think it would be pretty neat, rotate the sphere to suit the object, work out the new position based on the position of the 2 limbs and a 0.0 to 1.0 multiplier. I could show you what I mean if you post up your code.


Health, Ammo, and bacon and eggs!
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 22nd Jul 2010 18:18
Is this what you are trying to do?



Dark Physics makes any hot drink go cold.
Hell_666
17
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 22nd Jul 2010 20:32
@HowDo : No, I would want the sphere move on the box but it does stop it at the end of the box (in your code the box move and doesn't stop it after the sphere)


This is my code :



PS : I need to do this automatically, not manually as I would can do it (the example is simple because is the just the concept, in my project I want the player to can move on the walls in fact).

Eternal suffering ...

I'm french
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 22nd Jul 2010 20:56
same code but changed the order and it goes left and right.



Dark Physics makes any hot drink go cold.
Hell_666
17
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 22nd Jul 2010 21:31
I would want the sphere detect the end of the second object, because in true the model is a map in dbo format

Eternal suffering ...

I'm french
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 22nd Jul 2010 21:34
here it is using your code with left and right movment with a stop built in to stop it beraking out of the bar.



Dark Physics makes any hot drink go cold.

Login to post a reply

Server time is: 2026-07-25 16:41:21
Your offset time is: 2026-07-25 16:41:21