5 registered members (AndrewAMD, ozgur, Ayumi, 2 invisible),
690
guests, and 10
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
bulldozer track animation
#248839
01/29/09 13:36
01/29/09 13:36
|
Joined: May 2008
Posts: 331 Lithuania, Vilnius
Jaxas
OP
Senior Member
|
OP
Senior Member
Joined: May 2008
Posts: 331
Lithuania, Vilnius
|
Can any one explain, how it's work? i study bulldozer.c code, and i understand all except that one line: //anim track: my.u += 15 * player.force_left * time_step * (my.skill1 - 6) + 15 * player.force_right * time_step * (1 - my.skill1 + 6); What's that "my.u"? and how this line make track actually looks like they're moving?
The smaller the bug, the harder it is to kill. _________________________________________ Forklift DEMO (3dgs)
|
|
|
Re: bulldozer track animation
[Re: Jaxas]
#248842
01/29/09 14:15
01/29/09 14:15
|
mercuryus
Unregistered
|
mercuryus
Unregistered
|
You "shift" the texture over the models mesh (u=x-diretion, v=y-direction)
|
|
|
Re: bulldozer track animation
[Re: Jaxas]
#248852
01/29/09 15:14
01/29/09 15:14
|
Joined: May 2008
Posts: 331 Lithuania, Vilnius
Jaxas
OP
Senior Member
|
OP
Senior Member
Joined: May 2008
Posts: 331
Lithuania, Vilnius
|
but then i tried to compile i have an error, that "u" ir not a member of entity. And also,in manual there's said, that "this parameter is not used anymore in newer engine versions". It's don't work for A7 i think. Then how can i make same animation in A7?
Last edited by Jaxas; 01/29/09 15:15.
The smaller the bug, the harder it is to kill. _________________________________________ Forklift DEMO (3dgs)
|
|
|
Re: bulldozer track animation
[Re: Jaxas]
#248868
01/29/09 17:48
01/29/09 17:48
|
Joined: Dec 2005
Posts: 490 Germany/Berlin-Velten
kasimir
Senior Member
|
Senior Member
Joined: Dec 2005
Posts: 490
Germany/Berlin-Velten
|
here is the code:
function mtl_uvspeed_render()
{
mtl.matrix31 = floatd(my.skill1*total_ticks,256);
mtl.matrix32 = floatd(my.skill2*total_ticks,256);
}
function mtl_uvspeed_init()
{
// copy standard model material properties
mtl_copy(mat_model);
mat_identity(mtl.matrix);
mtl.event = mtl_uvspeed_render;
mtl.ENABLE_RENDER = on;
}
MATERIAL mtl_uvspeed =
{
event = mtl_uvspeed_init;
effect = "
matrix matMtl;
technique uvspeed
{
pass one
{
TextureTransformFlags[0] = Count2;
TextureTransform[0] = <matMtl>;
}
}
technique fallback { pass one { } }
";
}
action track()
{
my.material = mtl_uvspeed;
while(1)
{
my.skill1 += time_step * my_speed;
wait(1);
}
}
just use skill1 and skill2 instead of u / v! (it is also possible to change normal-mapping-shaders this way!)
|
|
|
|