Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (dr_panther, 7th_zorro), 1,203 guests, and 2 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
bulldozer track animation #248839
01/29/09 13:36
01/29/09 13:36
Joined: May 2008
Posts: 331
Lithuania, Vilnius
Jaxas Offline OP
Senior Member
Jaxas  Offline OP
Senior Member

Joined: May 2008
Posts: 331
Lithuania, Vilnius
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


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

M
mercuryus
Unregistered
mercuryus
Unregistered
M



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

Re: bulldozer track animation [Re: ] #248846
01/29/09 14:45
01/29/09 14:45
Joined: May 2008
Posts: 331
Lithuania, Vilnius
Jaxas Offline OP
Senior Member
Jaxas  Offline OP
Senior Member

Joined: May 2008
Posts: 331
Lithuania, Vilnius
mmm..i see, it's obvious now. Thanks wink


The smaller the bug, the harder it is to kill.
_________________________________________
Forklift DEMO (3dgs)
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 Offline OP
Senior Member
Jaxas  Offline 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? smile

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] #248860
01/29/09 16:57
01/29/09 16:57
Joined: Dec 2005
Posts: 490
Germany/Berlin-Velten
kasimir Offline
Senior Member
kasimir  Offline
Senior Member

Joined: Dec 2005
Posts: 490
Germany/Berlin-Velten
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!

Re: bulldozer track animation [Re: kasimir] #248864
01/29/09 17:12
01/29/09 17:12
Joined: May 2008
Posts: 331
Lithuania, Vilnius
Jaxas Offline OP
Senior Member
Jaxas  Offline OP
Senior Member

Joined: May 2008
Posts: 331
Lithuania, Vilnius
Mmm..that look like what i need. How to use that shader?


The smaller the bug, the harder it is to kill.
_________________________________________
Forklift DEMO (3dgs)
Re: bulldozer track animation [Re: kasimir] #248867
01/29/09 17:43
01/29/09 17:43
Joined: May 2008
Posts: 331
Lithuania, Vilnius
Jaxas Offline OP
Senior Member
Jaxas  Offline OP
Senior Member

Joined: May 2008
Posts: 331
Lithuania, Vilnius


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 Offline
Senior Member
kasimir  Offline
Senior Member

Joined: Dec 2005
Posts: 490
Germany/Berlin-Velten
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!)

Re: bulldozer track animation [Re: kasimir] #248869
01/29/09 18:13
01/29/09 18:13
Joined: May 2008
Posts: 331
Lithuania, Vilnius
Jaxas Offline OP
Senior Member
Jaxas  Offline OP
Senior Member

Joined: May 2008
Posts: 331
Lithuania, Vilnius
ok,thanks for advice wink


The smaller the bug, the harder it is to kill.
_________________________________________
Forklift DEMO (3dgs)

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

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