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 / Moving a limb AND its pivot point

Author
Message
MASTER OF PUPPETS
22
Years of Service
User Offline
Joined: 9th Jun 2004
Location: Trapped Under Ice
Posted: 7th Aug 2010 08:50
well,
i know that by moving a limb by itself using OFFSET LIMB, the limb that is moved, will move independently of its pivot point.

what i would like to know is how to move a limb independently of the containing object while preserving its pivot point.

so i guess what i mean is:

POSITION OBJECT X,0,0,0

now the object is at 0 on all coordinates
...lets say the limb i am talking about is the head
...being a symmetrical object the head is at....

x=0
y=50
z=0

...so the pivot point for the head is at,say....

x=0
y=45
z=0

OFFSET LIMB body,head,10,-45,0

will position the head 10 units on the x axis and on the floor while the pivot point for the head would still be...

x=0
y=45
z=0

how could i do something like...

(fake code)

position limb body,head,10,-45,0

now the pivot point of the head moved to the floor with the head.
THE KEY here is that (in this example) i would want the pivot point of the head to always stay at the spot on the head where the neck attaches, no matter where the head actually is

if that doesn't make sense let me know

metal is not music but a way of life...all hail to the reigning king METALLICA!!! [EDIT] ...well... up until "Load" came out.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 7th Aug 2010 15:08
The limb offset should include the pivot point, no idea why your having problems - but when I use a limbed object and offset, the pivot is offset as well.

Maybe upload your model so we can have a look, sounds to me like your export method has some issues.

Health, Ammo, and bacon and eggs!
MASTER OF PUPPETS
22
Years of Service
User Offline
Joined: 9th Jun 2004
Location: Trapped Under Ice
Posted: 8th Aug 2010 05:08 Edited at: 8th Aug 2010 09:56
ok,
one of two things is happening here, I am mistaken and you are right OR you don't understand what is happening/Im not being clear enough.

if you copy and paste this you will see what i am talking about...

NOTE!!!:keep in mind that the red sphere symbolizes the pivot point for the "gun"



the gun's pivot point stays with the camera which is fine in this example...

but if the gun had multiple limbs (like a "clip" for ammo)...
...and the pivot point of the clip was where the clip contacts the "gun"....
...how could i make the "clip" and its pivot point move in unison while leaving the "gun"'s pivot point on the "red sphere"

[edit]

..As far as the model itself or the export method,these models are dark basic primitives.

i just uploaded a quick mock up of what i am talking about. whatcha think?

metal is not music but a way of life...all hail to the reigning king METALLICA!!! [EDIT] ...well... up until "Load" came out.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 8th Aug 2010 13:25
Ahah, see it all depends on if the limbs are linked. If you link the clip to the gun limb, then moving the gun limb will move the clip as well - if you don't link the clip, then it'll stay where it is, and only orientate with the gun object.

In a modelling package, I would link all the parts of the gun regardless, because that way you would have really easy clip removal - because you could offset it on Y and a little on X, and it'll go away from the gun - but offsetting it to 0,0,0 again will put it back in the gun. The benefit is that it doesn't care how the gun itself is orientated. This stuff is always better done in a modelling package or animation package - I would animate the clip reload, and also animate the firing, and even have animation for the gun going out of screen and coming back again - for switching weapons. Much easier than trying to code it.

Health, Ammo, and bacon and eggs!
MASTER OF PUPPETS
22
Years of Service
User Offline
Joined: 9th Jun 2004
Location: Trapped Under Ice
Posted: 8th Aug 2010 14:00
yeah,
I see what you are saying.

If you look at the picture i uploaded, the clip IS linked to the gun.
the red sphere symbolize the pivot point.
Frame 2 - you see what I WANT to have happen. In Frame 3 - you see what DOES happen.

I just want to know if i can move a linked "limb" WITH its pivot point(frame 2).

What is happening is that the OFFSET LIMB command is actually moving the limb and NOT its pivot point(frame 3)

metal is not music but a way of life...all hail to the reigning king METALLICA!!! [EDIT] ...well... up until "Load" came out.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 9th Aug 2010 10:46
I don't think you can guage how it will work with that code, because your not adding the clip as an actual limb, it's just an object, so it's pivot etc is not gonna work the same.

What I tend to do, is get the gun at a good position in the modelling package, or rather, CharacterFX. Then I export that, and test it to make sure it sits on the screen how I like. So the object itself is offset to fit in screen. Then the clip would be a seperate limb, with it's pivot point set but linked to the main gun limb. So then if you rotate the object, or rotate a parent limb the whole lot will rotate and stay together. For a reload animation, I'd animate the clip being removed and replaced.

I think it'll work a lot better and be much clearer once you get a gun model.

Health, Ammo, and bacon and eggs!
MASTER OF PUPPETS
22
Years of Service
User Offline
Joined: 9th Jun 2004
Location: Trapped Under Ice
Posted: 9th Aug 2010 12:33 Edited at: 9th Aug 2010 12:36
OK,
you win ha ha I tried what you said and you are right.

I included a quick test gun that i made in about one and a half minutes.

Here is the code i tried



I guess i was wording my thoughts wrong from the get go...

My goal is to be able to move an object with AND without its pivot point.
that is easy enough with POSITION OBJECT AND OFFSET LIMB OB#,0,X,X,X

I would like to ALSO be able to move each limb inside an object WITH AND WITHOUT its pivot point. This for me in essence would achieve a pivot point altering function for a program i'm creating.
OFFSET LIMB OB#,LIMB#,X,X,X moves the limb WITH it's pivot point like you said. How would i go about moving a limb INDEPENDENTLY of its pivot point??? (thats the only missing link in all of this)

...and thank you for your help and patience on the matter!

metal is not music but a way of life...all hail to the reigning king METALLICA!!! [EDIT] ...well... up until "Load" came out.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 9th Aug 2010 12:42
No worries, glad you got it figured out.

To move a limb without moving it's pivot would need a hack of the vertexdata. With that, you would lock the vertexdata for the limb your moving, then adjust each vertex on XY and Z by your required amount. That might be fairly straightforward, the vertex commands are quite neat. You wouldn't be able to rotate the limbs this way without a lot of work - but you could certainly shift a limbs vertexes about the place and it won't affect the pivot point.

Health, Ammo, and bacon and eggs!
MASTER OF PUPPETS
22
Years of Service
User Offline
Joined: 9th Jun 2004
Location: Trapped Under Ice
Posted: 9th Aug 2010 13:46
great!
thank you sir.

metal is not music but a way of life...all hail to the reigning king METALLICA!!! [EDIT] ...well... up until "Load" came out.

Login to post a reply

Server time is: 2026-07-24 22:31:06
Your offset time is: 2026-07-24 22:31:06