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 / Position object delay

Author
Message
TuPP3
19
Years of Service
User Offline
Joined: 26th Jan 2007
Location: [+--]FINLAND
Posted: 1st Dec 2010 19:17 Edited at: 1st Dec 2010 19:26
So I've been wondering this problem how I should position my player's gun to his hand, so that I don't need animate the gun position, but only the hands, that would give me great advantages in animation.
But, when I use position object to hand limb position, I get massive delay when I turn the player.
Oddly I was able to prevent delay in horizontal axis when I place the position object before certain commands.
If I position the gun before rotating the player horizontally, I will get horizontal delay.
I'm not able to disable vertical delay anyhow.

With glue object to limb there isn't this delay, but I can't use it because when I need to reaload(bolt action) with right hand I don't want the gun to follow the hand.
I can't glue it to left hand either because I need to use it also separate from the gun(magazine change etc.).
I can use glue-unglue when needed because of the offset.

So how can I fix the position object delay? What does glue object to limb internally do because it doesn't have any delay?
Why I'm able to prevent horizontal delay, but not vertical?

And why is it rendering the weapon before everything is in place? I've only one sync at the end and everything is positioned before rendering.

Images of the delay:
http://i160.photobucket.com/albums/t187/TuPP3/delay.png?t=1291226921
Obviously the gun isn't rotated correctly.
After few milliseconds(looks horrible though) the gun will correct its position always to same place so it isn't pivot point or offest error.
General Jackson
User Banned
Posted: 1st Dec 2010 19:25
Can we see the code you have?

I am Southern, and I love Grits. Feel free to ask me what grits are if your a yankee
TuPP3
19
Years of Service
User Offline
Joined: 26th Jan 2007
Location: [+--]FINLAND
Posted: 1st Dec 2010 19:39 Edited at: 1st Dec 2010 19:49
Sure, but it does have so much variables and object and limb numbers so I thought it is hard to understand what rotates what.

So I need to explain how my player is constructed. I have full player body, not just the arms.
I rotate player horizontally by rotating the whole player model(55) to YAngPlayer#
I have 2 arm limbs LimbRUpperArm-1 and LimbLUpperArm-1 which I use for vertical angle.
There must be something wrong with the code order, but I don't get it how glue object works without delay then.
I've tried 100's of different combinations.



Here is screenshot how the player works:
http://i160.photobucket.com/albums/t187/TuPP3/player.png?t=1291228748

Gun(ObjTRG42) is positioned and rotated according the right hand limb(limb number 25).

688 is the head, ignore that. I had delay between the head and body too but I managed to prevent that by changing the command execution order.
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 1st Dec 2010 22:25
I experienced a similar fault with the position object command, I would position an object, then draw a line from it to it's target, if the object was moving the line would always be out of place. :/

TuPP3
19
Years of Service
User Offline
Joined: 26th Jan 2007
Location: [+--]FINLAND
Posted: 2nd Dec 2010 14:53 Edited at: 2nd Dec 2010 16:43
I wonder why is this happening, if I position the gun at the hand limb just the line before rendering, everything should be in place right?
I know that if I position the gun first and then the hand, the loop will have to go around the code and then posititon the gun = delay.

I want to know how glue object to limb handles this internally, or what should be the correct order to position everything so I won't have any delay
Or any alternative solution so I don't have to animate the weapon position.

I think this should be corect:
1.Player position
2.The whole player horizontal angle
3.Arms angle vertically
4.Gun position to hand
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 2nd Dec 2010 16:44
I'm not sure if this is true or not, but i'm sure I read that positioning the objects is only updated when the object is rendered... Which would make the object position x() etc command out of date by one frame... I don't know

TuPP3
19
Years of Service
User Offline
Joined: 26th Jan 2007
Location: [+--]FINLAND
Posted: 4th Dec 2010 11:17 Edited at: 4th Dec 2010 11:22
I'm able to place the weapon rigidly to the player if I rotate it with the same angle as the camera.
But then I won't have any animations with the hands.
I have my hands rigidly with the camera though.

I need just a way to have the weapon rigidly in player's hand and position and rotate with the hand.
How am I going to do this? My project is standing still and I'm quite frustrated with this simple thing.

I have Enhanced animations so I'm able to use EnAn_oacGetLimbRotx() commands to get the animation rotation only, but I think the pivot point or something is wrong because the weapon doesn't go with the hand.

So, how can I place object in my player's hand with animation?

I think there must be solution to this, anything, using glue object without the offset or any other idea.
TuPP3
19
Years of Service
User Offline
Joined: 26th Jan 2007
Location: [+--]FINLAND
Posted: 5th Dec 2010 17:13 Edited at: 5th Dec 2010 17:14
I made example to explain this delay which can be clearly seen here:
http://www.mediafire.com/?z0zdzb1cx1asobc

Here is the player .max model if anybody wants to see it(3ds Max 2009)
http://www.mediafire.com/?8fcvki26y8u7gk4
It is basically model bind to a 3ds max biped.



So what is causing this? How can I avoid it? What is glue object doing that position object+rotate object isn't?

(Btw. I didn't make the model or the textures)

Login to post a reply

Server time is: 2026-07-21 13:38:34
Your offset time is: 2026-07-21 13:38:34