Gamestudio Links
Zorro Links
Newest Posts
Z9 getting Error 058
by k_ivan. 04/25/26 19:13
ZorroGPT
by TipmyPip. 04/25/26 16:09
Stooq now requires an API key
by jcl. 04/13/26 09:42
Strange "Alien" Skull created with >Knubber<
by NeoDumont. 04/10/26 18:58
400 free seamless texture pack downl. here !
by NeoDumont. 04/08/26 19:55
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (Quad), 3,790 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
valino, juergenwue, VladMak, Geir, ondrej
19209 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
bone problem #133683
06/04/07 14:29
06/04/07 14:29
Joined: Apr 2006
Posts: 329
M
molotov Offline OP
Senior Member
molotov  Offline OP
Senior Member
M

Joined: Apr 2006
Posts: 329
function ala() //automated leg adjustment
{
var anga[3];
var leg1_temp[3];
var leg1_temp2[3];

vec_for_vertex(leg1_temp.x,my,189);
vec_set(leg1_temp2,leg1_temp);
vec_add(leg1_temp2,vector(0,0,10));

trace_mode = ignore_me+ignore_passable+ignore_models+ignore_sprites;
result = trace(leg1_temp.x,leg1_temp2.x);

if (result == -1)
{
anga.tilt += 1*time;
anga.roll -= 1*time;
ent_bonerotate(my,"bone2",vector(0,anga.tilt,anga.roll));
}
if (result == 0)
{
anga.tilt = 0; anga.roll = 0;
}
}

I'm using the above code to rotate a bone, but only when a certain vertex is in the ground. The trace works and when the vertex is in the ground the result is -1, and then bone2 should rotate around it's position. the problem is that bone2 is rotating but not at it's position but several quants above it. But when I remove the trace code section and make the bone2 rotate only when I press the key_h, the bone rotates how it should be. So somehow the trace interferes with the bonerotate code.

Hope this all makes sense and that someone can help me, Thanks anyway, Molotov.

Re: bone problem [Re: molotov] #133684
06/04/07 15:08
06/04/07 15:08
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline
User
tompo  Offline
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
it's hard to say without seeing this but...
i'll do this this way:
trace from vertex down... i mean temp.x and y at vertex position and z f.e. -50;
then if result <=0 (on the ground) then rotate the bone.

something like this:
Code:
 
function checking_ground
{
while(1)
{
vec_for_vertex(checking_pos, my, 189);
vec_set(temp, checking_pos.x);
temp.z = -50;
c_trace (checking_pos.x,temp,IGNORE_ME|IGNORE_PASSABLE|IGNORE_MODELS|IGNORE_SPRITES|SCAN_TEXTURE);
if(result <=0){rotate_bone();}
wait(1);
}
}

function rotate_bone
{
anga.tilt += 1*time; anga.roll -= 1*time;
ent_bonerotate(my,"bone2",vector(0,anga.tilt,anga.roll));
}


becouse bone will be always at the same model position as center of this bone until you will use ent_bonemove function.


Never say never.
Re: bone problem [Re: tompo] #133685
06/05/07 07:35
06/05/07 07:35
Joined: Apr 2006
Posts: 329
M
molotov Offline OP
Senior Member
molotov  Offline OP
Senior Member
M

Joined: Apr 2006
Posts: 329
Thanks Tompo for your reply, I've tested your code but it gives the same error. That's why I uploaded some images to give a better view of my problem. The first image shows how the legs of the crawler should be. The second image shows when the trace gives a -1 result and rotates the bone. You see that the leg of the crawler rotates but is also placed several quants above it's original position.

http://img513.imageshack.us/my.php?image=bonenormalma3.jpg
http://img104.imageshack.us/my.php?image=boneerrorsg4.jpg

Hope someone knows how to fix this, thanks anyway, Molotov.

Re: bone problem [Re: molotov] #133686
06/05/07 08:03
06/05/07 08:03
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline
User
tompo  Offline
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
in this case...
why don't You use animations frames with bones?! but 4 legs to anim... will be hard
are u sure you've merge this bones? (make all bones of model conected) and checked option about don't change legs original lenght? because distance from one hinge to second one is different on this screens

BTW... nice model... not skinned yet but nice


Never say never.
Re: bone problem [Re: tompo] #133687
06/05/07 08:45
06/05/07 08:45
Joined: Apr 2006
Posts: 329
M
molotov Offline OP
Senior Member
molotov  Offline OP
Senior Member
M

Joined: Apr 2006
Posts: 329
Hey Tompo thanks for your fast reply. The bones are all merged and the option is also checked. The different distance from one hinge to the second one, is the problem. But this problem doesn't appear when I remove the trace part and change the ent_bonerotate code so that it only makes the bone rotate when I press the key_h.

BTW, thanks for the compliment, I'm still working on the model his skin, but the actual design of the crawler model is finished.

Last edited by molotov; 06/05/07 08:47.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | 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