|
0 registered members (),
635
guests, and 2
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
vec_for_vertex and frame animation
#226613
09/10/08 15:25
09/10/08 15:25
|
Joined: Aug 2006
Posts: 155
RyuMaster
OP
Member
|
OP
Member
Joined: Aug 2006
Posts: 155
|
Hi! I have model which has jump frame-based animation. And I have hand attach to this model, using vec_for_vertex. (my.x is hand model)vec_for_vertex(handattachpoint,player,4991); my.x = handattachpoint.x; my.y = handattachpoint.y; my.z = handattachpoint.z; It all works fine, when model moves with c_move, hands stays attached and moves as well. But.. But, when model jumps, vec_for_vertex always returns the same value, like model is staying still. And hands are being placed wrong. Also, I tried to debug those values: handattachpoint.x; handattachpoint.y; handattachpoint.z; And here comes trouble. Those variables are changing only if I rotate player. They are the same even when player moves with c_move, or jumps. I do no get, how is that so? If my.x = handattachpoint.x; my.y = handattachpoint.y; my.z = handattachpoint.z; are not changing even when player moves, how do the hand stays attached?
Last edited by RyuMaster; 09/10/08 15:28.
What kills me not, that makes me stronger.
***Working on RPG/RTS***
|
|
|
Re: vec_for_vertex and frame animation
[Re: Pappenheimer]
#226652
09/10/08 17:22
09/10/08 17:22
|
Joined: Aug 2006
Posts: 155
RyuMaster
OP
Member
|
OP
Member
Joined: Aug 2006
Posts: 155
|
Nope, on every frame in hand_action(), assigned to hand entity. So it could re-align it position on every frame.
I have cheked all stuff, because it is nonsense for me.
If coordinates do not change after c_move, how come it still gets re-aligned correctly on entity move?
Well, maybe there is some stupid typo around code, still searching for it...
What kills me not, that makes me stronger.
***Working on RPG/RTS***
|
|
|
Re: vec_for_vertex and frame animation
[Re: RyuMaster]
#226654
09/10/08 17:28
09/10/08 17:28
|
Joined: Aug 2006
Posts: 155
RyuMaster
OP
Member
|
OP
Member
Joined: Aug 2006
Posts: 155
|
Oh, nevermind. They actually change on player move. But not when he jumps.
Is it normal, that vertex coordinates are not being updated during frame-animation? Can I force them to update somehow?
What kills me not, that makes me stronger.
***Working on RPG/RTS***
|
|
|
Re: vec_for_vertex and frame animation
[Re: RyuMaster]
#226695
09/10/08 19:47
09/10/08 19:47
|
Joined: Aug 2006
Posts: 155
RyuMaster
OP
Member
|
OP
Member
Joined: Aug 2006
Posts: 155
|
Shame on me, but I can not get it working. OK, I'll explaing as much as I know. I'm using kingod hearts script sample from wiki for movement. I have added jump there. Nothing special. Players presses "SPACE". Then animation blends or executes this, as it it in my case: ent_animate(my,"jump",my.animate,0);And, jump animation plays. I do not alter player.z value here. No gravity. Model jump is fully animated via MED, so it just jump in to the air and lands down, fully vertex animated. During his jump, I press F11 twice and this that: Bounding box is not affected. This is first thing which is bad. I fix it this way: if (my.animate > 10 && my.animate < 50) { vec_set(my.min_x,vector(-7.5,-7.5,2)); vec_set(my.max_x,vector(7.5,7.5,15)); } else { vec_set(my.min_x,vector(-7.5,-7.5,-6)); vec_set(my.max_x,vector(7.5,7.5,15)); }
Why do not bounding box goes up along with the model feets? Probably it is calculated only once, correct? But, if I set "c_setminmax(me);" during jump, bounding box is still the same. Now here comes vertexes. As a bounding box, they do not change their position during animation. So, if I alter player.z value, I can see it changing. Along with bounding box. But during frame vertex-based animation, nor box, nor vertexes are passing changing values. Why is that so? Have I missed something important?
What kills me not, that makes me stronger.
***Working on RPG/RTS***
|
|
|
Re: vec_for_vertex and frame animation
[Re: Pappenheimer]
#226699
09/10/08 20:09
09/10/08 20:09
|
Joined: Aug 2006
Posts: 155
RyuMaster
OP
Member
|
OP
Member
Joined: Aug 2006
Posts: 155
|
ent_animate(player,"jump",player.animate,0); player.animate+= 5 *time_step; if (player.animate > 100) { player.animate = 0; }
vec_for_vertex(handattachpoint,player,4991);
Same results. Entity jumps like crazy, no changings to vertex or bounding box. Very odd, indeed, ok I can see box is not changing, but vertexes DO right before my eyes.
What kills me not, that makes me stronger.
***Working on RPG/RTS***
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|