Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 801 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Small problem in Ragdoll code(orientation of Player) #298897
11/18/09 21:21
11/18/09 21:21
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline OP
Serious User
Rackscha  Offline OP
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
HI,
Since my last try for a ragdoll code, i have changed some things.
This is the code used to rotate a bone according to its physic bonde:

Code:
vec_set(ang_b.pan,parent_ent2.pan);
	str_cpy(source_bone,source_bone_input);
while(ent.skill1 == 0)
	{
		ang_diff(ang_a.pan,parent_ent2.pan,ang_b.pan); //calculate difference between old and new rotation of the physic-bone
vec_set(ang_b.pan,parent_ent2.pan);            
ent_bonerotate(ent,source_bone,ang_a.pan);//rotate the anim-bone by the angular difference we got 2 lines above	
wait(1);
}



This is working as long as the mainbody's orientation(this hinge is connected to) is (0,0,0). How do i use now the orientation of the main body to calculate the correct angles?



As you can see, the bonemovement of the anim-bone and the physic-bone is fitting...but only as long as the main body(the big white block) has an orientation of (0,0,0). I know i have to use its orientation in my code but untill now i couldnt get it to work(maybe iam too tired).

I think until now, i did everything correct this time(ok still need to calculate with the main bodies orientation)


NAd yes i seacrhed through the forum,(and my old topicy) but couldnt find a solution for the thing iam imagine grin.

Maybe someone can give me a hint to add the calculation of the mainbody.


EDIT: i think i have to subtract the angle of the mainbody from the rotation of the physic-bone to get the local rotation right? And it hink i have to use matrices? But how?


Greets
Rackscha

Last edited by Rackscha; 11/19/09 16:52.

MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: Small problem in Ragdoll code(orientation of Player) [Re: Rackscha] #299524
11/24/09 16:34
11/24/09 16:34
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
create your ragdoll as if it had no rotation to setup the hinges properly, and apply post-rotation to the whole body.

later on you want to place the position of all objects on the position of the bones for blending animations anyway...

that's how I used to do it laugh


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: Small problem in Ragdoll code(orientation of Player) [Re: Helghast] #299835
11/27/09 12:51
11/27/09 12:51
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline OP
Serious User
Rackscha  Offline OP
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
No,i meaned,when they body changes its orientation while acting like a ragdoll.
I didnt mean the startup.. The startup is currently always (0,0,0).


Iam not able to translate the global rotation of the Physic-bone to local rotation of the bone(if the orientation of the visible mesh is not (0,0,0) ).

Greets
Rackscha


MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: Small problem in Ragdoll code(orientation of Player) [Re: Rackscha] #300398
12/02/09 03:27
12/02/09 03:27
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
just read the angles of the hinge constraints and then rotate the models bone animations. Hinges are local values, and so are bones, you're doing unnecessary work.


xXxGuitar511
- Programmer

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1