Go Back   Winamp Forums > Visualizations > AVS

Reply
Thread Tools Search this Thread Display Modes
Old 4th August 2002, 17:37   #1
KeatonMill
Junior Member
 
Join Date: Jul 2002
Posts: 32
Fast Square Renderer

Hey guys. I've been playing around with stuff for my upcoming AVS pack, and I've got a question.

For a preset of mine, I've got a rotating square that changes colors. Currently, I do this with a SS that draws lots of line, but it takes a (relatively) long time to do that. Attached are two presets, one of them contains the entire preset, and the other just the square.
The question is, is there any better way to do that? I thought there was a way, by making a movement that just says
code:
d=0;
and a 1x1 DM that zooms and rotates, but it doesn't work.

Any ideas?
Thanks,
~Keaton
Attached Files
File Type: zip square.zip (1.1 KB, 62 views)
KeatonMill is offline   Reply With Quote
Old 4th August 2002, 17:56   #2
UnConeD
Whacked Moderator
 
UnConeD's Avatar
 
Join Date: Jun 2001
Posts: 2,104
The problem with a DM is that, when wrap is turned off, it stretches the edges so that the image always fits inside the window. I suggest you add a superscope that draws a black square around the edges, and then use a DM. If your gridsize is high enough and the black edges are not too thin, then you won't see any stretching.

Or you can leave wrap on and use alpha blending, but I think the previous technique is faster.

UnConeD is offline   Reply With Quote
Old 21st August 2002, 23:28   #3
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,149
Send a message via ICQ to jheriko
i've looked at your superscope, it is about a million times more complex than it needs to be. attached is a completely solid square preset (no holes at all) that rotates and changes color at much higher fps than either of your attempts (it peaks out on my system at about 60-70 at 320x200). it uses really simple code so you should just be able to look at it to understand it hopefully. if not all it does is draw a load of parallel lines in the shape of a square then multiplies the result by the 2d rotation matrix. the color change code i put in was just so that is wasn't plain white.

if this isn't what your trying to do then sorry for wasting your time.
if it is then i hope that it is helpful
Attached Files
File Type: zip good square.zip (301 Bytes, 63 views)

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 22nd August 2002, 00:44   #4
KeatonMill
Junior Member
 
Join Date: Jul 2002
Posts: 32
I made some improvements to that one as well. It turned out one of my biggest problems was the way I determined how many points to use. Instead of using more points to draw a bigger square, I did the opposite! Whoops! Well, anyway, the effect is done and now you'll just hafta wait until my pack comes out to see it...
KeatonMill is offline   Reply With Quote
Old 22nd August 2002, 09:45   #5
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,149
Send a message via ICQ to jheriko
yeah i did make it a bit quick you could have taken the sin and cos out of point and into frame for a bit more speed... anyways nice to know you figured it out

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 3rd September 2002, 10:22   #6
EL-VIS2
Member
 
Join Date: Jan 2002
Location: Germany
Posts: 73
FFSQ (f****** fast square)

This one uses the excactly the number of points needed for the current resolution. Remember:
one pixel on x in SSC-coords is 2/w
one pixel on y in SSC-coords os 2/h

init:
size=1

frame:
step=2/h;n=h*size;asp=h/w;
yp=-size/2;xp=-size/2;p=0;

init:
p=bnot(p);
yp=yp+p*step;xp=(-size/2+p*size)*asp


----------------------------

asp = aspect ratio x/y to keep square in different windows.
Remove this if you rotate the thing but now you don't get a real square. if you like to rotate the "square" you have to setup n depending on the max of width and height to avoid holes.

frame:
maxlines=max(w,h);step=2/maxlines;n=maxlines*size;
yp=-size/2;xp=-size/2;p=0;

Last edited by EL-VIS2; 3rd September 2002 at 11:11.
EL-VIS2 is offline   Reply With Quote
Old 3rd September 2002, 11:13   #7
EL-VIS2
Member
 
Join Date: Jan 2002
Location: Germany
Posts: 73
EXAMPLE

Here's an example of the above used with my 3D-SSC-Setup!
Attached Files
File Type: zip el-square.zip (508 Bytes, 64 views)
EL-VIS2 is offline   Reply With Quote
Old 5th September 2002, 09:32   #8
EL-VIS2
Member
 
Join Date: Jan 2002
Location: Germany
Posts: 73
COLORING THE THING

Worked a little more on the 3D-Setup using z3 and getosc and beat to color the square and doing music-reaction...
Attached Files
File Type: zip el-square2.zip (602 Bytes, 68 views)
EL-VIS2 is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Visualizations > AVS

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Jump