bulldozer track animation

Posted By: Jaxas

bulldozer track animation - 01/29/09 13:36

Can any one explain, how it's work? laugh 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? shocked
Posted By: Anonymous

Re: bulldozer track animation - 01/29/09 14:15

You "shift" the texture over the models mesh (u=x-diretion, v=y-direction)
Posted By: Jaxas

Re: bulldozer track animation - 01/29/09 14:45

mmm..i see, it's obvious now. Thanks wink
Posted By: Jaxas

Re: bulldozer track animation - 01/29/09 15:14

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? smile
Posted By: kasimir

Re: bulldozer track animation - 01/29/09 16:57

my bulldozer-game uses A7!!!

and my.u / my.v should work!
(i found it in the manuall)

if you are using shaders look at "mtlFX" script in the templates -> mtl_uvspeed!
Posted By: Jaxas

Re: bulldozer track animation - 01/29/09 17:12

Mmm..that look like what i need. How to use that shader?
Posted By: Jaxas

Re: bulldozer track animation - 01/29/09 17:43

i find working shader: http://www.opserver.de/ubb7/ubbthreads.p...true#Post233112
Posted By: kasimir

Re: bulldozer track animation - 01/29/09 17:48

here is the code:
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!)
Posted By: Jaxas

Re: bulldozer track animation - 01/29/09 18:13

ok,thanks for advice wink
© 2024 lite-C Forums