PDA

View Full Version : Aenema


Krash
11th January 2002, 13:35
Originally inspired by Zylot's sound blast, although it no longer contains any of zylot's code.

Alteration made at 10:35 board time on the 12th Jan 2k2.
Alteration is in bold.

==============
Krash - Aenema
==============
[preset00]
fRating=3.000000
fGammaAdj=2.000000
fDecay=0.980000
fVideoEchoZoom=2.000000
fVideoEchoAlpha=0.000000
nVideoEchoOrientation=0
nWaveMode=3
bAdditiveWaves=0
bWaveDots=0
bModWaveAlphaByVolume=0
bMaximizeWaveColor=1
bTexWrap=0
bDarkenCenter=0
bMotionVectorsOn=0
bRedBlueStereo=0
nMotionVectorsX=12
nMotionVectorsY=9
bBrighten=0
bDarken=0
bSolarize=0
bInvert=0
fWaveAlpha=0.800000
fWaveScale=1.028395
fWaveSmoothing=0.750000
fWaveParam=0.000000
fModWaveAlphaStart=0.750000
fModWaveAlphaEnd=0.950000
fWarpAnimSpeed=1.000000
fWarpScale=1.000000
fZoomExponent=1.000000
fShader=0.000000
zoom=1.000000
rot=0.000000
cx=0.500000
cy=0.500000
dx=0.000000
dy=0.000000
warp=1.000000
sx=1.000000
sy=1.000000
wave_r=0.100000
wave_g=0.500000
wave_b=0.500000
wave_x=1.000000
wave_y=0.550000
ob_size=0.010000
ob_r=0.000000
ob_g=0.000000
ob_b=0.000000
ob_a=0.100000
ib_size=0.010000
ib_r=0.600000
ib_g=0.000000
ib_b=0.000000
ib_a=0.200000
per_frame_1=warp = 0;
per_frame_2=dx = dx - .0005;
per_frame_3=dy = dy - .0005;
per_frame_4=wave_r = abs(wave_r + 0.1*(sin(time*0.346) + sin(time*1.334)));
per_frame_5=wave_g = wave_g + 0.15*(sin(time*0.763) + sin(time*1.231));
per_frame_6=wave_b = wave_b + 0.2*(sin(time*0.695) + sin(time*0.367));
per_frame_7=ob_r = wave_r;
per_frame_8=ob_g = wave_b - 0.1;
per_frame_9=ob_b = wave_g - 0.1;
per_frame_10=ib_a = 0.7 - bass;
per_pixel_1=du = x*2-1 - 0.7;
per_pixel_2=dv = y*2-1 + 0.5;
per_pixel_3=dist = sqrt(du*du+dv*dv);
per_pixel_4=ang2 = atan2(du,dv);
per_pixel_5=mult = 0.008/(dist+0.4);
per_pixel_6=dx = mult*sin(ang2-1.5);
per_pixel_7=dy = mult*cos(ang2-1.5);
per_pixel_8=du = x*2-1 - 0.7;
per_pixel_9=dv = y*2-1 - 0.5;
per_pixel_10=dist = sqrt(du*du+dv*dv);
per_pixel_11=ang2 = atan2(du,dv);
per_pixel_12=mult = 0.008/(dist+0.4);
per_pixel_13=dx = dx + mult*sin(ang2+1.5);
per_pixel_14=dy = dy + mult*cos(ang2+<b>1.4</b>);
per_pixel_15=dy = dy - if(below(y, 0.65), if(above(y, 0.35), 0.1*(y-0.5) + 0.01*sin(x*30+time*4), 0), 0);
per_pixel_16=dx = dx - if(above(dx,-0.01), if(below(dx,0), 0.006, 0), 0);

- Krash

Krash
11th January 2002, 14:46
I've been fiddling with this a little, and managed to get a whole bunch of very interesting effects. Even adding an video echo can generate some very attractive stuff. There's alot of potential for mods here, but I'm not in the mood to post anything myself. Have at it, people!

- Krash

Rovastar
11th January 2002, 17:08
Well worth the wait mate.

I will have fun doing mods of this.

But what does atan2 do??

bmelgren
11th January 2002, 17:54
Here's my first tweak of it. I like part of what changing the per_pixel 3 & 10 from sqrt to tan does, but don't like the fixed polygons it leaves.

bmelgren
11th January 2002, 18:11
Was curious bout that too... My tweak looks better without em.
Just take em out on mine for a better effect.
per_pixel_4=ang2 = atan2(du,dv);
per_pixel_11=ang2 = atan2(du,dv);

bmelgren
11th January 2002, 22:27
I'm sure.

Krash
12th January 2002, 07:14
To be honest, I'm not entirely sure what atan2 does. That part of the code istaken directly from ryan's dynamic swirls (except without the dynamic part).
Atan stands for arc tangent. Arc trig functions is the one thing I've never been sure about. I have a maths textbook lying around somewhere, I may look it up.

- Krash

Krash
12th January 2002, 07:43
Right. The reason I've never understood what it means, is because I've never referred to the procedure as an arc-whatever.

arctan is essentially the opposite of tan. When you're doing things with a right-angled triangle, the tan of angle theta is the length of the opposite side of the triangle divide by the length of the adjacent side (not the hypotenuse). Arctan is doing the same thing is reverse. So arctan(1/3) = theta, where tan(theta) = 1/3.
In milkdrop, this would be represented by atan(1,3), where 1 is the numerator, and 3 is the denominator.

Of course, this raise the problem as to what the hell is atan2? to be honest, I've no idea. It's not listed in the preset authoring guide. Maybe it's a mistake on ryan's part.

- Krash

unchained
12th January 2002, 10:57
I've noticed you get the "fixed polygons" whenever you do anything involving the ang variable. I guess it has to do with the mesh size...I've never really tried to diagnose it, I've just noticed that whenever I change all of the trig functions into sine mappings my presets lose that "pixelated" look.

Rovastar
14th January 2002, 20:10
BTW folks I also found exp() as a function.

and UnConeD who is one of the main bods on the AVS forums gave me this explanation for Atan2.

=========================================
exp(a) is the same as pow(e, a), where e is euler's constant (2.7182..., the base of natural logarithms).

atan2(y,x) calculates the arctangent of (y/x), except that it checks the quadrants the point (x,y) is in and wether or not x equals zero. Atan2 is very handy to from rectangular to polar coordinates:

r = atan2(y,x)
d = sqrt(sqr(x)+sqr(y)) -> pythagoras' formula

This is the normal way it's done, however because AVS puts "0 rotation" on the vertical axis at the top (instead of on the horizontal axis on the right, as is usually done), you'll have to switch around y and x in atan2 and add a minus sign. Can't tell you out of the top of my head which it is.
=========================================

Now I don't totally understand it all yet but that is what it means. I am assured.;)

Readers stop looking at this post confused Krash and Unchained might find this interesting.;)

BTW it is not in the MilkDrop documentation because it is not in the AVS documentation and that is where the MD functions are copied from.

Rovastar

geiss
15th January 2002, 06:20
yep, atan2(y,x) is the arctan function.

A review on the Tangent (not arctangent) function:
-----------
pick any (x,y) point on the unit circle (so theta in the range 0..2pi, and radius is 1). Then take the y-coordinate of that point (sin(theta)) divide it by the x-coordinate of that point (cos(theta)). Bang, this is the tangent of this angle; this is the meaning of the tangent function. Picture the graph of this, or plot it out for yourself. Notice how it repeats just like sin and cos.

So what happens at angles where x (on the unit circle) approaches zero? You get division by zero, so the tangent function approaches infinity. That's why tan(z) gives you huge, crazy numbers at pi/2, 3*pi/2, 5*pi/2, etc - because the cosine of these angles is zero, and it creates a division by zero. (picture going around the unit circle from x=1 (pi=0), counter-clockwise, and you'll see that these are the angles where x is zero.)

And back to atan:
-----------------
atan() is just the inverse function; you give it the tangent value and it gives you the angle for which tan(angle) = that value. You'll notice that atan always returns a number between -pi/2 and +pi/2; this is because tan() goes (monotonically increasing) from -infinity to +infinity in this range of theta (and is zero at zero); so *any* number you plug into atan() will be the tangent of some angle from -pi/2 to pi/2.

Check out this link for some tutorials & interactive learning with trig functions:
http://www.studyworksonline.com/cda/explorations/main/0,1123,NAV2-23,00.html

Cheers,
Ryan

StudioMusic
15th January 2002, 12:41
Ryan thanks so much for this explanation of atan, was pretty much beyond my knowledge, but the link you gave is going to help me tremendously. Thanks again, Studio Music

unchained
15th January 2002, 14:33
You crazy folks and your angles.