Page 1 of 1

Animated flags

Posted: Fri Jun 06, 2003 12:52 pm
by Zip
I'm not sure whether this should be in here or scripts......

Is it possible to make a flag that flutters in the wind?

Posted: Fri Jun 06, 2003 1:09 pm
by General Death
The way EA has done it is by models.

Im sure this could be done also by a shader with your custom texture.

Something like this:

Code: Select all

textures/yourfoldername/yourtexturename
{
      	qer_keyword flag
	surfaceparm trans
	surfaceparm nonsolid
	surfaceparm nomarks
	surfaceparm noimpact
	cull none
	nomipmaps
	nopicmip
	deformVertexes flap t 60 sin 0 1.5 0	0.1 1 0
	deformVertexes flap t 60 sin 0 1.5 0.20 0.2 1 0

	{
		map textures/yourfoldername/yourtexturename.tga
		depthWrite
		alphaFunc GE128
	nextbundle
		map $lightmap
	}
}
Modify the deformVertexes line values in the shader to produce the effect you want. May also work better with a path mesh then a brush since I have tried this with brushes and it loses the effect.

If you want the same effect as the models in mohaa you may want to see what shader info it has :)

Posted: Fri Jun 06, 2003 1:16 pm
by Zip
I knew I should have kept my mouth shut, that sounds a bit to hard for me at the moment. I need to learn more stuff before I attempt that by the sounds of it. Thanks though :)

Does anyone have an example of one, or better still have a British flag already made I can, erm, steal :? ?

Posted: Fri Jun 06, 2003 1:19 pm
by General Death
E-mail me the texture and Ill make a test map for you so you can see the shader at work :)

Gendeath@planetmedalofhonor.com

Posted: Fri Jun 06, 2003 1:56 pm
by General Death
Heres a test map of the shader at work...needs alittle work but I think you get the idea:

testflag.zip

Check you mail also Zip :)

Posted: Fri Jun 06, 2003 2:11 pm
by Zip
That was very kind of you, thanks :)

I think I want it wobble more, can I use 'pakscape' to find the script and edit it or shall i make a new script called testflag.scr?

Posted: Fri Jun 06, 2003 2:14 pm
by General Death
yes or simply use winzip also :)

You can edit the script without having to recompile also to see the effects :)

Ill have to look and find what each value controls...

Posted: Sat Jun 07, 2003 1:10 pm
by General Death
General Death wrote:Ill have to look and find what each value controls...

Code: Select all

Here are the explanations for the deform values: 

EXPLANATION 

flap___s|t___div___function___base___amplitude___.phase__frequency___optionalmin__optionalmax 

flap____t____128______sin_______0________4_______.25_______.25 __________1 __________0_____ 

Posted: Sat Jun 07, 2003 4:04 pm
by Zip
Thanks General :D

Posted: Sun Jun 08, 2003 2:14 am
by General Death
I got your e-mails and ill answer them Sunday :)

Posted: Sun Jun 08, 2003 8:58 am
by mohaa_rox
look at a nazi flag which explains it.