Winamp & Shoutcast Forums > AVS Tips&Tricks in AVS
 User Name Remember Me? Password

 Thread Tools Search this Thread Display Modes
 1st May 2003, 17:24 #81 UnConeD Whacked Moderator     Join Date: Jun 2001 Posts: 2,104 AVS axer: actually no. The line below the one you 'corrected' uses atan to imitate atan2. Therefore it should still be "You can imagine atan2 to be the same as this...." ('this' refers to that line of code).
 2nd May 2003, 05:38 #82 AVS Axer Member     Join Date: Feb 2003 Location: Ozshtrayleeuh Posts: 98 Sorry, i should have checked with yu first... i thought 'this' was referring to the bit above, not the bit below..
 2nd May 2003, 14:54 #83 Jaheckelsafar Major Dude   Join Date: Feb 2002 Location: home Posts: 1,318 percent value ll : lower limit hl : higher limit val : value (val-ll)/(hl-ll) gives a number between 0 and 1 for a number between the lower limit and the higher limit. Stoke me a clipper. I'll be back for Christmas. - Arnold Rimmer Red Dwarf
 2nd May 2003, 16:08 #84 Deamon Major Dude     Join Date: Nov 2002 Location: Arnhem, the Netherlands Posts: 927 is that equal to: (0.5*sin(val)+1) ? .:HyperNation @ winamp:. .:DeviantArt:. Thermal is now available for download at DeviantArt.
 3rd May 2003, 04:25 #85 sidd Major Dude     Join Date: May 2003 Location: Australia Posts: 1,353 uh, no.. not at all his method keeps the scale linear. (0.5*sin(val)+1) would return a soinsoid of val between 0 and 1. in other words it loops, and doesnt really produce a version of the variable 'val'. (val-ll)/(hl-ll) would return val exactly, only scaled between 1 and 0, instead of high limit and low limit. The variable remains linear
 3rd May 2003, 10:54 #86 Deamon Major Dude     Join Date: Nov 2002 Location: Arnhem, the Netherlands Posts: 927 ok thank you .:HyperNation @ winamp:. .:DeviantArt:. Thermal is now available for download at DeviantArt.
 12th May 2003, 04:34 #87 sidd Major Dude     Join Date: May 2003 Location: Australia Posts: 1,353 I came up with this a while back and have been usingit heaps, thought it might be useful to everyone out there. This converts hue,sat,lum color mode to r,g,b. So you can have more control over your color coding in superscopes. all hue sat and lum values are between 0 and 1. Hue, follows red-> green-> blue in 1/3 sections. For all those who dont know, hue is the color, sat is the intensity of that color, and lum is the amount of black(0) or white(1) in that colour. As you can imagin, the code is VERY useful, but unfortunatly isnt as small as one would like, it takes up 11 variables!!, i might be able to make that 8 but its tricky. ```code:hue=1; lum=0.5; sat=t; tm2=if(below(lum,0.5),lum*(1+sat),lum+sat-lum*sat); tm1=2*lum-tm2; tm3r=hue+1/3; tm3g=hue; tm3b=hue-1/3; tm3r=if(above(tm3r,1),tm3r-1,if(below(tm3r,0),tm3r+1,tm3r)); tm3g=if(above(tm3g,1),tm3g-1,if(below(tm3g,0),tm3g+1,tm3g)); tm3b=if(above(tm3b,1),tm3b-1,if(below(tm3b,0),tm3b+1,tm3b)); rd=if(below(6*tm3r,1),tm1+(tm2-tm1)*6*tm3r,if(below(2*tm3r,1), tm2,if(below(tm3r*3,2),tm1+(tm2-tm1)*((2/3)-tm3r)*6,tm1))); gr=if(below(6*tm3g,1),tm1+(tm2-tm1)*6*tm3g,if(below(2*tm3g,1), tm2,if(below(tm3g*3,2),tm1+(tm2-tm1)*((2/3)-tm3g)*6,tm1))); bl=if(below(6*tm3b,1),tm1+(tm2-tm1)*6*tm3b,if(below(2*tm3b,1), tm2,if(below(tm3b*3,2),tm1+(tm2-tm1)*((2/3)-tm3b)*6,tm1))); green=if(sat,gr,lum); blue=if(sat,bl,lum); red=if(sat,rd,lum);```
 12th May 2003, 11:29 #88 Montana Major Dude     Join Date: Dec 2001 Location: SÃ¶dertÃ¤lje, Sweden Posts: 1,058 hsv to rgb, fast version init: tpi=acos(-1)*2; pit=tpi/6; tpit=pit*2; pixel: sat2=sat*0.5; hue2=hue*tpi; red=abs(sin(hue2))*sat2+lum; green=abs(sin(hue2+pit))*sat2+lum; blue=abs(sin(hue2+tpit))*sat2+lum; batman
 12th May 2003, 12:19 #89 sidd Major Dude     Join Date: May 2003 Location: Australia Posts: 1,353 nice work!! few problems with it obviously, cuz its simplifying a complicated process into only a few lines. luminuesence isnt scalar, nor is it dithered between colours correctly. Same deal with saturation. for example, 0 lum should make it black regarless. all values should be between 0-1, or something else as long as it is finite. And the line 'hue2=hue*tpi' should be just hue*pi. Im gonna use your code when i just need a nice color fading code, but ill stick with the other way for accuracy.
 13th May 2003, 16:54 #90 shreyas_potnis Major Dude     Join Date: Jan 2003 Location: Mumbai, India Posts: 787 i already used some of such code in the flow contest to make the ssc http://home.iitb.ac*****~shreyaspotnis
 13th May 2003, 21:49 #91 dirkdeftly Forum King     Join Date: Jun 2001 Location: Cydonia, Mars Posts: 2,651 actually, that "fast" version isn't nearly correct, but it's a comparatively good approximation, and you get more proverbial bang for your buck "guilt is the cause of more disauders than history's most obscene marorders" --E. E. Cummings
 22nd May 2003, 03:34 #92 VisualAgnosia Senior Member     Join Date: Nov 2002 Location: Australia Posts: 190 Ozshtrayleeuh --- Repra - zent
 22nd May 2003, 06:28 #93 sidd Major Dude     Join Date: May 2003 Location: Australia Posts: 1,353 a big w00t to that sir.
 22nd May 2003, 21:04 #94 dirkdeftly Forum King     Join Date: Jun 2001 Location: Cydonia, Mars Posts: 2,651 a big 57f|_| to that sir. visag, i'm going to tell you this one last time. STOP MAKING THOSE FUCKING RANDOM POSTS "guilt is the cause of more disauders than history's most obscene marorders" --E. E. Cummings
 23rd May 2003, 08:06 #96 dirkdeftly Forum King     Join Date: Jun 2001 Location: Cydonia, Mars Posts: 2,651 no where did i put that "ban him" screenshot... gd material belongs in gd, KEEP IT THERE. "guilt is the cause of more disauders than history's most obscene marorders" --E. E. Cummings
 24th May 2003, 03:33 #97 sidd Major Dude     Join Date: May 2003 Location: Australia Posts: 1,353 an interlect which we will probably never uinderstand. atero, the king off being pissed off at whatever is happening anywhere. The cunning smarts of posting a useless message to inform someone that they have posted a useless message. If that isnt the most intelegent thing you have ever seen, please post and tell me what is. But i wont chack on GD, so post it here! HAHA! sigh
24th May 2003, 16:05   #98
sidd
Major Dude

Join Date: May 2003
Location: Australia
Posts: 1,353
i posted this on another thread, and thought it should go here:

Quote:

 24th May 2003, 20:29 #99 dirkdeftly Forum King     Join Date: Jun 2001 Location: Cydonia, Mars Posts: 2,651 which is, afaik, not true. put the top slidebar all the way to the left and you get rgb, put the second slidebar all the way to the left and you get low contrast, fast cycling pallettes. check out my post in the "Laser? WTF?" thread "guilt is the cause of more disauders than history's most obscene marorders" --E. E. Cummings
 25th May 2003, 07:31 #100 Raz Forum King     Join Date: Dec 2002 Location: Manchester Posts: 6,470 Lets try to keep this thread for tips and tricks about avs and not about how atero has pms and how visag posts random stuff. Really, who cares? And if they do, why? Is there something wrong with their brain that means they have to get pissed off at the slightest fault. Atero, it's not the end of the world if theres one random post. Sometimes random posting is funny. Theres no need to go all anal and be the hitler of the forum. Now... avs... Oh yeah, nice to see you back visag, try not to provoke him too much.
 27th May 2003, 09:34 #101 shreyas_potnis Major Dude     Join Date: Jan 2003 Location: Mumbai, India Posts: 787 RGB - HSL Convert the RBG values to the range 0-1 Example: from the video colors page, colorbar red has R=83%, B=7%, G=7%, or in this scale, R=.83, B=.07, G=.07 Find min and max values of R, B, G In the example, maxcolor = .83, mincolor=.07 If the max and min colors are the same (ie the color is some kind of grey), S is defined to be 0, and H is undefined but in programs usually written as 0 Otherwise, L = (maxcolor + mincolor)/2 For the example, L = (.83+.07)/2 = .45 Test L. If L < 0.5, S=(maxcolor-mincolor)/(maxcolor+mincolor) If L >=0.5, S=(maxcolor-mincolor)/(2.0-maxcolor-mincolor) For the example, L=0.45 so S=(.83-.07)/(.83+.07) = .84 If R=maxcolor, H = (G-B)/(maxcolor-mincolor) If G=maxcolor, H = 2.0 + (B-R)/(maxcolor-mincolor) If B=maxcolor, H = 4.0 + (R-G)/(maxcolor-mincolor) For the example, R=maxcolor so H = (.07-.07)/(.83-.07) = 0 To use the scaling shown in the video color page, convert L and S back to percentages, and H into an angle in degrees (ie scale it from 0-360) HSL - RGB If S=0, define R, G, and B all to L Otherwise, test L. If L < 0.5, temp2=L*(1.0+S) If L >= 0.5, temp2=L+S - L*S In the colorbar example for colorbar green, H=120, L=52, S=79, so converting to the range 0-1, L=.52, so temp2=(.52+.79) - (.52*.79) = .899 temp1 = 2.0*L - temp2 In the example, temp1 = 2.0*.52 - .899 = .141 Convert H to the range 0-1 In the example, H=120/360 = .33 For each of R, G, B, compute another temporary value, temp3, as follows: for R, temp3=H+1.0/3.0 for G, temp3=H for B, temp3=H-1.0/3.0 if temp3 < 0, temp3 = temp3 + 1.0 In the example, Rtemp3=.33+.33 = .66, Gtemp3=.33, Btemp3=.33-.33=0 For each of R, G, B, do the following test: If 6.0*temp3 < 1, color=temp1+(temp2-temp1)*6.0*temp3 Else if 2.0*temp3 < 1, color=temp2 Else if 3.0*temp3 < 2, color=temp1+(temp2-temp1)*((2.0/3.0)-temp3)*6.0 In the example, 3.0*Rtemp3 < 2 so R=.141+(.899-.141)*((2.0/3.0-.66)*6.0=.141 2.0*Gtemp3 < 1 so G=.899 6.0*Btemp3 < 1 so B=.141+(.899-.141)*6.0*0=.141 Scale back to the range 0-100 to use the scaling shown in the video color page For the example, R=14, G=90, B=14 Found on the net http://home.iitb.ac*****~shreyaspotnis
 27th May 2003, 16:59 #102 dirkdeftly Forum King     Join Date: Jun 2001 Location: Cydonia, Mars Posts: 2,651 it'd be quite a bit more useful if you could link us to the page... "guilt is the cause of more disauders than history's most obscene marorders" --E. E. Cummings
 28th May 2003, 05:56 #103 sidd Major Dude     Join Date: May 2003 Location: Australia Posts: 1,353 hang on, what use is RGB-HSL if the only time you ever get to specify colours in code form is in the superscope, where you can only use RGB for output. also, your HSL-RGB code is exactly the same as given above, only mine was already coded for avs.
 28th May 2003, 06:06 #104 dirkdeftly Forum King     Join Date: Jun 2001 Location: Cydonia, Mars Posts: 2,651 well, axer, that's probably because they use the same algorithm "guilt is the cause of more disauders than history's most obscene marorders" --E. E. Cummings
 28th May 2003, 06:38 #105 sidd Major Dude     Join Date: May 2003 Location: Australia Posts: 1,353 that was kinda the point atero... they both use the HSL-RGB algorithm... so why post it twice? you follow?
 28th May 2003, 07:38 #106 dirkdeftly Forum King     Join Date: Jun 2001 Location: Cydonia, Mars Posts: 2,651 whereas your algorithm was compiled (sorta), and shreyas's post explained it in detail. and...afaik there is only one hsl/rgb algorithm. excepting sat={1,0} and lum={1,0}, it's a one-to-one function "guilt is the cause of more disauders than history's most obscene marorders" --E. E. Cummings
 28th May 2003, 09:09 #107 sidd Major Dude     Join Date: May 2003 Location: Australia Posts: 1,353 well, thats not entirely true, there are many different ways of alligning the hue value to show as loop from 0-1. It is not neccessarily correct to have red, green or blue in any order, (although it is normally R-G-B). Also, most methods use sine to 'shape' the scale. The one me and shreyas used doesnt, it just uses linear 1/3's.
 28th May 2003, 13:34 #108 shreyas_potnis Major Dude     Join Date: Jan 2003 Location: Mumbai, India Posts: 787 Conding the algo in AVS sort of makes it a bit more complicated, so I just posted the algo here. No need to post the link, as I have copied whatever was preset on the page http://home.iitb.ac*****~shreyaspotnis
 28th May 2003, 14:14 #109 sidd Major Dude     Join Date: May 2003 Location: Australia Posts: 1,353 ok
 28th May 2003, 21:52 #110 dirkdeftly Forum King     Join Date: Jun 2001 Location: Cydonia, Mars Posts: 2,651 and...look at your hsl colorpicker some time. does it look like it has a sinusoidal interpolation? no, i'm afraid it doesn't. and what do you see when h=0? red. h=240? red. that's just the way it is, i'm sorry.... "guilt is the cause of more disauders than history's most obscene marorders" --E. E. Cummings
 29th May 2003, 00:18 #111 sidd Major Dude     Join Date: May 2003 Location: Australia Posts: 1,353 rightyo.. enough on this please
 6th June 2003, 10:52 #112 shreyas_potnis Major Dude     Join Date: Jan 2003 Location: Mumbai, India Posts: 787 Metaballs dm, I made it some time ago: ```code: init: dc=1.2;g1=1;g2=1; Frame: bf=(bf+.1)/1.1;mov=tx1*tx2*tx3;af=h/w; tx1=(tx1+dx1*.1)/1.1;ty1=(ty1+dy1*.1)/1.1; tx2=(tx2+dx2*.1)/1.1;ty2=(ty2+dy2*.1)/1.1; tx3=(tx3+dx3*.1)/1.1;ty3=(ty3+dy3*.1)/1.1; tx4=(tx4+dx4*.1)/1.1;ty4=(ty4+dy4*.1)/1.1; tx5=(tx5+dx5*.1)/1.1;ty5=(ty5+dy5*.1)/1.1; Beat: dx1=(rand(200)/100-1)*dc;dy1=(rand(200)/100-1)*dc; dx2=(rand(200)/100-1)*dc;dy2=(rand(200)/100-1)*dc; dx3=(rand(200)/100-1)*dc;dy3=(rand(200)/100-1)*dc; dx4=(rand(200)/100-1)*dc;dy4=(rand(200)/100-1)*dc; dx5=(rand(200)/100-1)*dc;dy5=(rand(200)/100-1)*dc; bf=2; Pixel: y=y*af; x1=x+tx1; y1=y+ty1; x2=x+tx2; y2=y+ty2; x3=x+tx3; y3=y+ty3; x4=x+tx4; y4=y+ty4; x5=x+tx5; y5=y+ty6; d1=pow(sqrt(sqr(x1)+sqr(y1))*g1,g2); d2=pow(sqrt(sqr(x2)+sqr(y2))*g1,g2); d3=pow(sqrt(sqr(x3)+sqr(y3))*g1,g2); d4=pow(sqrt(sqr(x4)+sqr(y4))*g1,g2); d5=pow(sqrt(sqr(x5)+sqr(y5))*g1,g2); d=d1*d2*d3*d4*d5; x=x1+x2+x3+x4+x5; y=y1+y2+y3+y4+y5; r=atan2(x1,y1)+mov; alpha=bf-min(bf,d) ``` I am quite happy with the end results, dunno if its done before. http://home.iitb.ac*****~shreyaspotnis
 6th June 2003, 13:24 #113 Tuggummi Bin King     Join Date: Mar 2001 Location: Finland Posts: 2,173 shift per pixel A simple trick for advanced avsers. To shift a scope by pixel. X-axis xt=xt+(#/w)*2 Y-axis yt=yt+(#/h)*2 #=ammount of pixels skipped. 1=none , 0=no movement Example: per frame xt=xt+(2/w)*2 ; per pixel y=i*2-1 ; x=if(above(xt,1),-1,xt) This will shift your scope by skipping every other line. ```code: |-|-|-|- ``` Notice that if you want to skip 2 pixels, you don't use 2 you use 3. A way of "remembering" it is to write it like this: xt=xt+(#/w)*2+2/w 2/w adds the extra pixel, so that what ever number you use in # it will skip that ammount of pixels. Of course it's better to use straight up higher number, but it's just for convenience. example: xt=xt+(3/w)*2+2/w Will move the scope like this: ```code: |---|---|---|---|--- ``` Notice also that shifting per pixel won't work with sin&cos, only when you apply it directly to the scope movement it will work, you can use the if functions to limit the movement of the scope or to make it warp to the otherside once it reaches the end. Texer Resources Im retarded... err i mean retired! Probably both...
 14th June 2003, 19:43 #114 shreyas_potnis Major Dude     Join Date: Jan 2003 Location: Mumbai, India Posts: 787 A very neat trick to darken the colours a little bit. use an effect list with input replace and outpuit multiply. this will squrare the colours. as rgb are 0....1 then if RGB are not 0 or 1 their squares will be less than the original numbers! http://home.iitb.ac*****~shreyaspotnis
 15th June 2003, 03:27 #115 Zevensoft Major Dude     Join Date: Apr 2002 Location: Ballarat, Australia Posts: 529 It's effectively exactly the same as a Gamma 0.5 ramp. If you invert the colours before and after, it becomes a Gamma 2.0 ramp. 1 | 2 | 3 | 4 | 3W | 4WW
 15th August 2003, 16:40 #117 jheriko Forum King     Join Date: Aug 2002 Location: a twist in the fabric of space Posts: 2,150 Those DMs could use some optimisation. Remember that putting things in if statements means that both results are calculated so for instance: x=if(equal(k,k4)+equal(k,k5),abs(x)*col,-abs(x)*col); should be x=if(equal(k,k4)+equal(k,k5),1,-1)*abs(x)*col; one less abs and one less * than before. -- Jheriko 'Everything around us can be represented and understood through numbers'
 15th August 2003, 17:36 #118 kPlanet Junior Member   Join Date: Aug 2003 Location: Ger Posts: 6 There are anywhere "TipsTricks in AVS" for german people!?^^ who know some... thx
 15th August 2003, 19:11 #119 anubis2003 Forum King     Join Date: Dec 2002 Location: middle of somewhere Posts: 5,564 nein, keine "Tips and tricks" für deutsche. [Over The Monkey] | [My DeviantArt] | [Seti] | [Atmo Digital Design Forums]
 15th August 2003, 19:43 #120 kPlanet Junior Member   Join Date: Aug 2003 Location: Ger Posts: 6 och warumn ni!? da müsste sich mal einer ransetzen...^^ und... nein ich werd das nicht sein! löl
 Winamp & Shoutcast Forums > AVS Tips&Tricks in AVS
 User Name Remember Me? Password

 Thread Tools Search this Thread Search this Thread: Advanced Search Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Tech Support Greatest Hits Winamp     Winamp Technical Support     Winamp Discussion     Winamp Wishlist     Winamp Bug Reports     Winamp for Android     Winamp Site Design Shoutcast     Shoutcast Technical Support     Shoutcast Discussions     Shoutcast For Business & Monetization     Shoutcast Site Design International Connection     International Connection     Русскоязычный форум (Russian)     Français: de l'aide pour les francophones (French)     Winamp Deutsch (German) Community Center     General Discussions     Breaking News     Music O'Rama     Games Center     Movies and Television     The Bitchlist Skinning and Design     Skinning Tips and Tricks     Classic Skins     Modern Skins     Arts and Design Developer Center     Winamp Development     NSIS Discussion         NSIS Translations Visualizations     AVS         AVS Presets         AVS Wishlist         AVS Troubleshooting     MilkDrop         MilkDrop Presets         MilkDrop Development         MilkDrop Feature Requests         MilkDrop Troubleshooting Forum

 -- Deutsch -- English (US) -- Polish -- Russian Winamp.com - Help - Archive - Top