Poor Man's 3D by diabolik diabolik@nitric.net This article will explain how to take those cheap "3d glasses" you get in cereal boxes and comic books and use them with Winamp's AVS studio to create very realistic 3d spectrum analyzer effects and trip for days. It's pretty simple - and amazing. When it works, you can get effects reaching about a foot to two feet out of your screen toward you. Very trippy. The trick to acheiving a 3d effect from your monitor is a pair of those old '3d glasses' you'd get as a kid to turn red and blue lines to turn into a shitty purple picture that was sort of, but not quite, 3d. Disclaimer: You can hurt your eyes doing this. The day after I figured it out, I woke up with a pretty bad headache. You can experience anything from nausia to tiredness and just a plain bad headache. If those "Magic Eye" things weren't for you, don't attempt this. Use at your own risk - its not my fault. Don't blame me. What you will need: A computer (actually, although its not that intense graphically, you should have a pretty good video card. The higher the frame rate, the nicer this effect looks. More importantly, a low resolution will force the spectrum analyzers to cancel each other out more often and will result in distorted pictures.) a pair of 3d glasses (these are the ones with a piece of red cellophane on one eye, and blue cellophane on the other. The ones I'm using have red over the left eye, and blue over the right. If yours aren't the same, wear them backwards or mod my code.) WinAMP with AVS studio (these are what I wrote the '3d mod' presets in). You'll want to be fullscreening these effects at 640x480, although yesterday I was ICQing while I had a portion of my monitor displaying the AVS and the effect was noticeable - it hurt a lot more, too. Booming techno always helps. Aphex Twin, Clint Mansell... whatever floats your boat. How to make the Presets: You can download the presets from http://c0nstruk7.hypermart.net/, but I strongly suggest writing your own. The AVS presets I wrote are simple spectrum analyzers, a blue analyzer with a red analyzer offset to the right of the blue. The more the two are offset, the closer to your eyes they appear. In Winamp's AVS studio, the x and y coordinates of the screen begin at -1 and end at 1, no matter what the resolution is. In order to make the analyzer's appear to be bulging out of the screen, the offset between the red and blue analyzers (I'll just refer to this as the offset from now on) must vary. A good value for the offset I found was c*cos(2*y)+0.05 for vertical slopes and c*cos(2*x)+0.05 for horizontal slopes, where c is a value of from 0.05 to 0.2 (note: these values work well for a 14" monitor at about 2 feet away. You may have to modify this range in order to suit your setup). Since the scopes are offset horizontally, it is easier to see a vertical scope in 3d because the two scopes will cancel each other out less - this is where a higher resolution comes into play. The higher the detail of the scopes, the less one scope will overwrite its companions position, and the better looking the result. To make a throbbing vertical scope, try the following: 1. Open the AVS studio, (start the visualization and double click in the window). Make a new preset. 2. Add a trans/fade (+ -> trans -> fadeout). Set it to be fast enough - you can slow it later if you like the effect. Personally I just click on "Main" and check off "clear every frame" so the effect is as clean as possible. 3. Add a Superscope (+ -> render -> Superscope) with the following settings: Init: n=40; t=0; tv=0.1;dt=1; Per Frame: t=t*0.9+tv*0.1; Per Point: x=t+v*(pow(sin(i*3.14159),1)/2)+(0.03*cos(2*y)); y=i*2-1.0; x=x*1.5-0.09 Check off 'Waveform', 'Center', and 'Lines'... although you can modify those as you wish, thats just what I suggest. This will be the blue scope. To accurately choose your color, see "Calibrating your preset" below. click the 'x2' button to copy this Superscope. Modify this one to have the following settings: Init: n=40; t=0; tv=0.1;dt=1; On Beat: c=((rand(100)/100)*0.08)+0.07; Per Frame: t=t*0.9+tv*0.1;c=c*.9; Per Point: x=t+v*(pow(sin(i*3.14159),1)/2)+(c*cos(2*y))+0.05; y=i*2-1.0; x=x*1.5-0.09; This is only slightly more complex than a flat surfaced (in 3-space) scope. When the OnBeat function is run, the offset between the two scopes is randmized between 0.07 and 0.15. Every frame, the offset is reduced to 90% of its previous value (the scope appears to shrink back towards the screen). Although Winamp's beat detection isn't that great, during good house music or anything with good bass, you will definitely "see" the effect. You can get another neat effect by making two sets of scopes - one vertical, one horizontal, and have them come out of the screen OnBeat random amounts, with or without decay. To make a 3d horizontal scope, I use the following settings for each scope: Blue Scope: Init: n=40; t=0; tv=0.1;dt=1; Per Frame: t=t*0.9+tv*0.1 Per Point: y=t+v*(pow(sin(i*3.14159),1)/2); x=i*2-1.0+(0.03*cos(2*x)); y=y*1.5; Red Scope: Init: n=40; t=0; tv=0.1;dt=1; On Beat: c=((rand(100)/100)*0.07)+0.08; Per Frame: t=t*0.9+tv*0.1;c=c*.9; (this would be to decay the scope back to the screen, otherwise remove the latter equation) Per Point: y=t+v*(pow(sin(i*3.14159),1)/2); x=i*2-1.0+(c*cos(2*x))+0.05; y=y*1.5; Another interesting effect you could try would be to change cos(2*x) to abs(cos(4*3.14159*x)) This would make two 3d ripples in the analyzer, instead of just coming out once, it would come out, go back in, out, and in again. What can't I do to the presets? I strongly recommend you make your own - mine are just working guides. You probably can do a lot better if you've ever made winamp AVS settings before - until this project I never tried. However, don't think that you will throw some crazy blur effect into the mix and it will be even more trippy. For this effect to work, the blue pixel must be immediately offset to the left of the red pixel for your eyes to combine them into a single 3d point. I've found to get the most effective 3d effect, keep your presets clean. Whatever effects you do attempt to add, keep in mind, if the red and blue lines cross (this is a reference to a vertical scope - in a horizontal scope, they will cross all the time...) you will lose the 3d effect immediately. It would be really interesting to get a dot-plane working with this effect, but unfortunately I've found that there are far too many dots at most angles to not have one dot plane overlap a large portion of the other. You could do this by writing a AVS plugin in C++, but that is outside the scope of this article. What can I do with the presets? Noting the limitations above, you can have some damn cool effects. The most noticable thing you can do is modify 'c' in the formula dynamically. WinAMP's AVS studio contains the ability to do "OnBeat" modifications to your variables. Calibrating Your preset: To get the best 3d effect, you want the brightest color of red that still appears dark to the eye seeing through the blue cellophane, and vice versa. To find the right shade of blue, double click on the blue bar near the bottom-right of the window. Put on your glasses. close your right eye. Choose a shade of blue that appears dark to your left eye. You should now be looking at the light-to-dark blue vertical gradient near the bottom right of the color selector through the red cellephane. Move the brightness selector upwards as high as it goes while it still appears black, or near black. This will make the color as noticeable as possible to your right eye while still appearing as nothing to your left eye. Click okay, and calibrate the second "Render/Superscope"'s color by doing the opposite of what you did for the first. If when looking at the presets through the glasses you can see what almost looks like shadows of the scopes on the screen itself, try darkening the chosen shades of blue and red. Other Ideas with the glasses: Obviously, WinAMP AVS modules are just one idea for these glasses. With basic VB skillz one could write 3d wireframing modules or a starfield generater, in pseudo-3d. Of course, you're limited to the color of purple, but considering you've paid about a dollar or less for these you shouldn't really complain. One suggestion I've had from a friend was to make an hour-long mixtape, export the whole thing to VHS and bring the tape, 20 pairs of the glasses, and a lot of booze/weed/cough syrup/whatever to a party and have a nice massive trip. Conclusion: Well, when it works, it works well. If you can't get your crazy ass preset to work on the first try, attempt to simplify it - I've found its a lot easier to see two scopes than one, but 3 or more need a warm up of simpler effects. Other things you can try are shifting your head from side to side - this helps you really see the effect I've found. If you have too many scopes (four instead of two), try changing the distance or angle you're viewing. Just experiment, half the fun's just seeing what you can come up with... then again a good chunk of it is staying up 'till 4am coaxing some cough syrup listening to aphex twin in headphones. Greetz: HackCanada, argv, clox, the other members of Priapism, JaidenKnight, all my local friends - you know who you are. 2600 Magazine, Volume 19, Number 1, Spring 2002 - page 12, 13