As i have made avs for 2 years now, i really don't know much about how to do things differently.
Confused?
Read more.
As Advanced Visualization Studio is a highly customizable visualization plugin/component there are usually many ways to do simple things. And when it comes to coding your own superscopes and dynamic movements there are several different ways to make things, like in the dynamic movement using rectangular coordinates rather than polar coordinates to create the exactly same effect.
Sometimes if you do things differently you may gain some priviledges, like better frame rates or the benefits of using a different coordinate system. Also when you use the built-in functions differently you may get faster&better results than doing the same thing with different effects.
EXAMPLE
Creating a rotoblitter effect in movement with both polar- & rectangular coordinates.
Polar
r=r+0.1
BENEFITS:
Simple, easy and a fast way.
Rectangular
x=x+y*0.1 ;
y=y-x*0.1
BENEFITS:
You can shift it around the screen which can't be done in polar coordinates.
These helpful speed up tricks and better quality tips are scattered all over the forum, so what im asking here is to collect all those helpful notes into a single forum post, this post.
So feel free to post your ideas and comments how something that is frequently used can be done faster&better, this is all for the common good and will surely help us all as we are always searching a alternative way to make presets.
And please remember that, althought the most tips consider coding there is still many different ways to use the built-in effects differently and still get the same effect. If you have discovered a clever way of using example: Trans / Water , you can post it here so it will help other avs artists as well.
Hope you all understanded the point of this post and hope that you all contribute as much as you can 😉
Tips&Tricks in AVS
274 posts
Rotoblitter in polar:
r=r+spin;
d=d*(zoom+1);
Rotoblitter in rectangular:
x1=x; zoom2=zoom+1;
x=x*zoom2+y*spin;
y=y*zoom2+x1*spin;
Just a bit of a fix by your friendly local anal retentive AVSer... 😉
r=r+spin;
d=d*(zoom+1);
Rotoblitter in rectangular:
x1=x; zoom2=zoom+1;
x=x*zoom2+y*spin;
y=y*zoom2+x1*spin;
Just a bit of a fix by your friendly local anal retentive AVSer... 😉
2 ways of shifting values, not sure which is executed faster:
value = value * (1-speed) + target * speed;
or
value = value + (taget - value) * speed;
value = value * (1-speed) + target * speed;
or
value = value + (taget - value) * speed;
No order targeting:
value = target
First order targeting:
value = (value + target * speed) / (speed + 1)
Linear Interpolation:
value = value1 * position + value2 * (1-position)
Bilinear Interpolation:
value12 = value1 * posx + value2 * (1-posx)
value34 = value3 * posx + value4 * (1-posx)
value = value12 * posy + value34 * (1-posy)
Trilinear Interpolation:
value12 = value1 * posx + value2 * (1-posx)
value34 = value3 * posx + value4 * (1-posx)
value56 = value5 * posx + value6 * (1-posx)
value78 = value7 * posx + value8 * (1-posx)
value1234 = value12 * posy + value34 * (1-posy)
value5678 = value56 * posy + value78 * (1-posy)
value = value1234 * posz + value5678 * (1-posz)
value = target
First order targeting:
value = (value + target * speed) / (speed + 1)
Linear Interpolation:
value = value1 * position + value2 * (1-position)
Bilinear Interpolation:
value12 = value1 * posx + value2 * (1-posx)
value34 = value3 * posx + value4 * (1-posx)
value = value12 * posy + value34 * (1-posy)
Trilinear Interpolation:
value12 = value1 * posx + value2 * (1-posx)
value34 = value3 * posx + value4 * (1-posx)
value56 = value5 * posx + value6 * (1-posx)
value78 = value7 * posx + value8 * (1-posx)
value1234 = value12 * posy + value34 * (1-posy)
value5678 = value56 * posy + value78 * (1-posy)
value = value1234 * posz + value5678 * (1-posz)
Two questions...
First order targeting is increasing a value by increments (speed), until it reaches target, right?
What is (bi/tri)linear interpolation?
First order targeting is increasing a value by increments (speed), until it reaches target, right?
What is (bi/tri)linear interpolation?
Bilinear is interpolation linearly in 2D... like zooming on a picture, but instead of blocky pixels you get a blurry, smooth texture.
Trilinear is interpolation linearly in 3D. It's commonly used to interpolate bilinearly between textures and linearly between an MIP-maps on a 3D card.
Trilinear is interpolation linearly in 3D. It's commonly used to interpolate bilinearly between textures and linearly between an MIP-maps on a 3D card.
What i would like to know is: What is the fastest way to create a fullscreen gradient? I have used this method:
1 single ssc line
INIT: n=2
PER POINT: x=i*2-1 ; y=1
1 movement with rect coords (bilinear filtering on)
y=y-0.0x
It could also be done by using a gradient line and then using a movement with x=0.
Which way is faster? Or is there even a faster way to do it?
Thanks 🙂
1 single ssc line
INIT: n=2
PER POINT: x=i*2-1 ; y=1
1 movement with rect coords (bilinear filtering on)
y=y-0.0x
It could also be done by using a gradient line and then using a movement with x=0.
Which way is faster? Or is there even a faster way to do it?
Thanks 🙂
Tug: in his HiRes pack that came with J7, jheriko used a vertical line, and a static movement with r=0. Looks awesome.
uNDefineD, it creates a conical gradient, right?
Different gradients:
Linear:
1 SuperScope
Init:
n=100 (the more numpoints the more accurate gradient)
Per Point:
x=i*2-1 ;
y=0 ;
col=i ;
blue=col ; red=col ; green=col
1 Movement
Rect Coords ON
Bilinear Filtering ON/OFF (not absolutly necessary, it looks ok even without it)
Code:
y=0
Radial:
1 SuperScope
Same as in Linear
1 Movement
Rect Coords ON
Bilinear Filtering ON
Code:
y=0 ;
x=d
Im not sure how the conical gradient is done, but i guess it's just using the r=0 movement and then using a color code in a superscope like col=sin(i*pi). I don't have avs right now so i can't check did i get those other two right, so ill edit this post tomorrow (at 8:XXam gmt +2).
Different gradients:
Linear:
1 SuperScope
Init:
n=100 (the more numpoints the more accurate gradient)
Per Point:
x=i*2-1 ;
y=0 ;
col=i ;
blue=col ; red=col ; green=col
1 Movement
Rect Coords ON
Bilinear Filtering ON/OFF (not absolutly necessary, it looks ok even without it)
Code:
y=0
Radial:
1 SuperScope
Same as in Linear
1 Movement
Rect Coords ON
Bilinear Filtering ON
Code:
y=0 ;
x=d
Im not sure how the conical gradient is done, but i guess it's just using the r=0 movement and then using a color code in a superscope like col=sin(i*pi). I don't have avs right now so i can't check did i get those other two right, so ill edit this post tomorrow (at 8:XXam gmt +2).
🙄
Look in my 3rd pack (desert sunset) to see how to do fullscreen gradients in 1 scope.
Look in my 3rd pack (desert sunset) to see how to do fullscreen gradients in 1 scope.
Well yes you can use just one superscope, but to fill the entire screen with just one superscope requires a big numpoint number and the bigger the resolution the more numpoints and more slower it is. With the scope and the movement technique the numpoint number always stays the same and still the whole screen gets filled with the gradient.
There for the movement and ssc technique is a lot faster than using one BIG ssc.
There for the movement and ssc technique is a lot faster than using one BIG ssc.
the fastest way I know to make a gradient is:
scope:
n=w*detail; < whith deatil going from 2/w to 1 >
x=x*2-1;y=0;
red=blabla;green=blablabla;green=blabla;
movement:
x=0;
scope:
n=w*detail; < whith deatil going from 2/w to 1 >
x=x*2-1;y=0;
red=blabla;green=blablabla;green=blabla;
movement:
x=0;
GRADIENTS :
Note : "v" stands for variable (Replace with something), and it will be number-tagged. Red/green/blue is to be coded yourself.
Vertical, Horizontal, and Radial gradients already mentioned. Remember, you can always use another D/M to morph the gradient into one desired.
Fullscreen Gradients :
Horizontal gradient (Colors cycling left-right) :
x=-1+i*2;
v1=bnot(v1) OR v1=1-v1
y=v1*2-1;
Vertical : Exchange x and y.
Polar : You'll need dot-grid and colorcode it... Too slow.
-You can combine Hor. and Ver. Gradients to make combinations. Experiment with render modes.
Cheap fullscreen combo gradient :
Use 2 lines, perpendicular, use a good linewidth (30-50 should do it), then use a movement to fill the screen. (Technique from several of UnConeD's presets) (Is it copyrighted? 😛)
Dot-Grid :
http://forums.winamp.com/showthread....threadid=83695 - But I'll post the code here for convenience. The one here have edited variables to signify the new variables.
FRAME :
v1=w+1; v2=h+1; n=v1*v2; v3=0; v4=0; v5=1/ww; v6=1/hh;
POINT :
x=v3*v5*2-1; y=v4*v6*2-1;
v3=if(above(v3+1,v1),0,v3+1);
v4=if(v3,v4,v4+1);
--
But of course, that will be goddamn slow. You can always reduce the amount of points and manipulate the size to conform with the screen.
In colorcoding, use x and y, i won't work well. Additional tips are in the original page.
Examples : El-Vis - I Cannot Dance, Carry Me Home, Lucy In The Sky With Diamonds, and some others.
It's quite slow, but is the most versatile, providing you use the right effects. You can also use convolution filter to make the pixels bigger and make a pixel-doubled effect.
--
All I can think for now... I think there are more ways...
Note : "v" stands for variable (Replace with something), and it will be number-tagged. Red/green/blue is to be coded yourself.
Vertical, Horizontal, and Radial gradients already mentioned. Remember, you can always use another D/M to morph the gradient into one desired.
Fullscreen Gradients :
Horizontal gradient (Colors cycling left-right) :
x=-1+i*2;
v1=bnot(v1) OR v1=1-v1
y=v1*2-1;
Vertical : Exchange x and y.
Polar : You'll need dot-grid and colorcode it... Too slow.
-You can combine Hor. and Ver. Gradients to make combinations. Experiment with render modes.
Cheap fullscreen combo gradient :
Use 2 lines, perpendicular, use a good linewidth (30-50 should do it), then use a movement to fill the screen. (Technique from several of UnConeD's presets) (Is it copyrighted? 😛)
Dot-Grid :
http://forums.winamp.com/showthread....threadid=83695 - But I'll post the code here for convenience. The one here have edited variables to signify the new variables.
FRAME :
v1=w+1; v2=h+1; n=v1*v2; v3=0; v4=0; v5=1/ww; v6=1/hh;
POINT :
x=v3*v5*2-1; y=v4*v6*2-1;
v3=if(above(v3+1,v1),0,v3+1);
v4=if(v3,v4,v4+1);
--
But of course, that will be goddamn slow. You can always reduce the amount of points and manipulate the size to conform with the screen.
In colorcoding, use x and y, i won't work well. Additional tips are in the original page.
Examples : El-Vis - I Cannot Dance, Carry Me Home, Lucy In The Sky With Diamonds, and some others.
It's quite slow, but is the most versatile, providing you use the right effects. You can also use convolution filter to make the pixels bigger and make a pixel-doubled effect.
--
All I can think for now... I think there are more ways...
DOH! I thought the edit time was 3 days 😛 (i don't remember where i heard that but it was somewhere around these forums, oh well...)
Ok Here we go again!
Gradients
Linear
Ssc
Init:
n=255
Per Point:
x=i*2-1 ;
y=0 ;
col=i ;
red=col ; green=col ; blue=col
Movement
Bilinear Filtering OFF
Rect Coords ON
Code:
y=0
Radial
Ssc
Same as in Linear
Movement
Bilinear Filtering OFF
Rect Coords ON
Code:
y=0 ;
x=-d*1.5+0.5
Rectangular
Ssc
Init:
n=255 ; pi=acos(-1)
Per Point:
x=i*2-1 ;
y=0 ;
col=sin(i*pi) ;
red=col ; green=col ; blue=col
2 Movements
1st
Bilinear Filtering OFF
Rect Coords ON
Code:
y=0
2nd
Bilinear Filtering OFF
Rect Coords ON
Code:
x=-if(above(y*y,x*x),y*y,x*x)*1.75+0.75 ;
Conical
Ssc
Same as in Rectangular
2 Movements
1st
Bilinear Filtering OFF
Rect Coords ON
Code:
y=0
2nd
Bilinear Filtering ON
Rect Coords OFF
Code:
r=((r-1.25)*1.25)*0.35 ;
d=r
This time i actually made them, so they now work right. If you have trouble understanding code, or are just lazy download these example presets i made. Includes all the 4 gradients and a "real" preset i made in about 10 minutes that uses a "Dynamic-Gradient-Utone" 😛
Ok Here we go again!
Gradients
Linear
Ssc
Init:
n=255
Per Point:
x=i*2-1 ;
y=0 ;
col=i ;
red=col ; green=col ; blue=col
Movement
Bilinear Filtering OFF
Rect Coords ON
Code:
y=0
Radial
Ssc
Same as in Linear
Movement
Bilinear Filtering OFF
Rect Coords ON
Code:
y=0 ;
x=-d*1.5+0.5
Rectangular
Ssc
Init:
n=255 ; pi=acos(-1)
Per Point:
x=i*2-1 ;
y=0 ;
col=sin(i*pi) ;
red=col ; green=col ; blue=col
2 Movements
1st
Bilinear Filtering OFF
Rect Coords ON
Code:
y=0
2nd
Bilinear Filtering OFF
Rect Coords ON
Code:
x=-if(above(y*y,x*x),y*y,x*x)*1.75+0.75 ;
Conical
Ssc
Same as in Rectangular
2 Movements
1st
Bilinear Filtering OFF
Rect Coords ON
Code:
y=0
2nd
Bilinear Filtering ON
Rect Coords OFF
Code:
r=((r-1.25)*1.25)*0.35 ;
d=r
This time i actually made them, so they now work right. If you have trouble understanding code, or are just lazy download these example presets i made. Includes all the 4 gradients and a "real" preset i made in about 10 minutes that uses a "Dynamic-Gradient-Utone" 😛
Here are some code tips for you. 🙂
Optimise everything. Higher FPS makes your presets a lot nicer. Here are some examples:
3D transformation
x=x1/z1;
y=y1/z1;
can be made faster by using:
z1=1/z1;
x=x1*z1;
y=y1*z1;
using trig in conjunction with a timer can be made faster too:
on beat:
drx=0.2*getosc(0.2,0.2,0);
per frame:
rx=rx+drx;crx=cos(rx);
per pixel:
x=crx;
y=0;
Using this sort of thing a lot can make your code faster. 🙂
Optimise everything. Higher FPS makes your presets a lot nicer. Here are some examples:
3D transformation
x=x1/z1;
y=y1/z1;
can be made faster by using:
z1=1/z1;
x=x1*z1;
y=y1*z1;
using trig in conjunction with a timer can be made faster too:
on beat:
drx=0.2*getosc(0.2,0.2,0);
per frame:
rx=rx+drx;crx=cos(rx);
per pixel:
x=crx;
y=0;
Using this sort of thing a lot can make your code faster. 🙂
3D transformation is:
Xp=Xc/Zc;
Yp=Yc/Zc;
where Xc (x-coordinate) and Yc are any numbers, positive or negative, and Zc is positive.
For a 3D object centered at the origin (0,0,0), use this formula:
Xp=Xc/(Zc+sqrt(mD));
Yp=Yc/(Zc+sqrt(mD));
where mD (maximum distance) is the largest distance from the origin to a point on the object.
Rotation around any point, line, plane, solid, etc:
Ar=Ac*sin(theta)+Bc*cos(theta);
Br=Ac*cos(theta)-Bc*sin(theta);
where A and B are the axes defining the plane perpendicular to the axial point/line/plane/solid etc. To find the perpendicular plane, simply use the 2 axes you do not use to define the axial object.
Xp=Xc/Zc;
Yp=Yc/Zc;
where Xc (x-coordinate) and Yc are any numbers, positive or negative, and Zc is positive.
For a 3D object centered at the origin (0,0,0), use this formula:
Xp=Xc/(Zc+sqrt(mD));
Yp=Yc/(Zc+sqrt(mD));
where mD (maximum distance) is the largest distance from the origin to a point on the object.
Rotation around any point, line, plane, solid, etc:
Ar=Ac*sin(theta)+Bc*cos(theta);
Br=Ac*cos(theta)-Bc*sin(theta);
where A and B are the axes defining the plane perpendicular to the axial point/line/plane/solid etc. To find the perpendicular plane, simply use the 2 axes you do not use to define the axial object.
Quote:
Rotation around any point, line, plane, solid, etc:
Ar=Ac*sin(theta)+Bc*cos(theta);
Br=Ac*cos(theta)-Bc*sin(theta);
where A and B are the axes defining the plane perpendicular to the
axial point/line/plane/solid etc. To find the perpendicular plane,
simply use the 2 axes you do not use to define the axial object.
Another way to do this(slower way) is:
d=sqrt(Ac*Ac+Bc*Bc);r=atan2(Ac,Bc)+theta;
Ar=sin(r)*d;Br=cos(r)*d;
Rotation around any point, line, plane, solid, etc:
Ar=Ac*sin(theta)+Bc*cos(theta);
Br=Ac*cos(theta)-Bc*sin(theta);
where A and B are the axes defining the plane perpendicular to the
axial point/line/plane/solid etc. To find the perpendicular plane,
simply use the 2 axes you do not use to define the axial object.
Another way to do this(slower way) is:
d=sqrt(Ac*Ac+Bc*Bc);r=atan2(Ac,Bc)+theta;
Ar=sin(r)*d;Br=cos(r)*d;
It's a whole lot slower, and it's much easier on AVS to use the rotation matrix
That and you can optimise the rotation matrix if your not using it for a parameterisation or something else where the rotations change for every point.
I have a kind of a problem, I have used a static background/texture for a movement with bunch of effects. I have made it by putting all the effects inside a effectlist with ignore/replace and on beat active 1 frame. Then i have used a custom bpm set to 30bpm and put both of them inside another effect list with ignore/replace. It now takes about 1-3 seconds to start, but the fps is much higher since it doesn't have to render the texture all the time. This solution works fine, but what im asking is: Is there a even better way doing this? If you use avs effects to create a static background is there a way to only "render" it once? Or how i activate it right at the begin of a song?
Hope you understand 🧟
Hope you understand 🧟
Tuggummi: I think there isnt any better way. I had the same problem some time ago and only thing I learned is how limited effect custom bmp is. Atero posted something at the whishlist about a user defined custom bmp so we can only wait for the next avs.
You could just use Custom BPM and set it to skip as many beats as possible, then set First Skip to 1.
3D SSC
Here is a wonderful guide to AVS written by El-vis that was posted a while ago. It gives code to create a superscope in 3D, rotate in along and move it along the x, y, and z axis (what's the spelling for the plural of axis?)
Here is a wonderful guide to AVS written by El-vis that was posted a while ago. It gives code to create a superscope in 3D, rotate in along and move it along the x, y, and z axis (what's the spelling for the plural of axis?)
I think it's 'axes'.
A better 3D code system:
init: zs=sqrt(... *)
frame:
rx=rx+drx; ry=ry+dry; rz=rz+drz; cx=cos(x); sx=sin(x); cy=cos(y); sy=sin(y); cz=cos(z); sz=sin(z);
pixel:
... *
x2=x1*sz+y1*cz; y2=x1*cz-y1*sz;
x3=x2*sy+z1*cy; z2=x2*cy-z1*sy;
y3=y2*sx+z2*cx; z3=1/(y2*cx-z2*sx+zs);
x=x3*z3; y=y3*z3;
* This should be the maximum distance from the center to a point on your scope, multiplied by 2. For a unit sphere, use the radius of the sphere multiplied by 2.
** x1, y1, and z1 are the coordinates for your shape, and should be put here.
rx, ry, and rz are the angles of rotation around the x, y, and z axes, respectively. These angles are in radians (one radian = 180/pi degrees)
A good place to define these values is in the beat section of the scope, e.g.:
rx=rand(100)/1000-0.05; ry=rand(100)/1000-0.05; rz=rand(100)/1000-0.05;
init: zs=sqrt(... *)
frame:
rx=rx+drx; ry=ry+dry; rz=rz+drz; cx=cos(x); sx=sin(x); cy=cos(y); sy=sin(y); cz=cos(z); sz=sin(z);
pixel:
... *
x2=x1*sz+y1*cz; y2=x1*cz-y1*sz;
x3=x2*sy+z1*cy; z2=x2*cy-z1*sy;
y3=y2*sx+z2*cx; z3=1/(y2*cx-z2*sx+zs);
x=x3*z3; y=y3*z3;
* This should be the maximum distance from the center to a point on your scope, multiplied by 2. For a unit sphere, use the radius of the sphere multiplied by 2.
** x1, y1, and z1 are the coordinates for your shape, and should be put here.
rx, ry, and rz are the angles of rotation around the x, y, and z axes, respectively. These angles are in radians (one radian = 180/pi degrees)
A good place to define these values is in the beat section of the scope, e.g.:
rx=rand(100)/1000-0.05; ry=rand(100)/1000-0.05; rz=rand(100)/1000-0.05;
Don't kill me for this, but you're just pathetic. You're stressing your head dozens of priceless minutes. And for what ?! For saving about 0.0001 fps with using a different method !?
Don't get me wrong. I'm sure that these tips comes in handy for n00bs and if there's alot to be optimized, but these tips.... It's like thinking how could you put the wires to your electric toothbrush from car, so that you could recharge the battery with it, so it wouldn't see in electric bill...
Don't get me wrong. I'm sure that these tips comes in handy for n00bs and if there's alot to be optimized, but these tips.... It's like thinking how could you put the wires to your electric toothbrush from car, so that you could recharge the battery with it, so it wouldn't see in electric bill...
Dear Degnic...
1) Are you talking to everyone who has replied to this forum or to one person and if, who?
2) The faster the presets run the more enjoyable they are, besides it's more than just 0.<insert ridiculous large ammount of zeros>1 frames, example the gradients work a lot faster when you use different methods. And the static texture for a 3D movement or likes saves up huge ammount of fps if it is only rendered once per N beats. I made a preset with the static texture and the framerate difference between render-per-N-beat and render-all-the-time is incredibly huge, on my 266mhz pentium it was about 8 fps.
3) Everything & Anything can & should be optimized. Or do you draw a static single colored ssc line with 800 numpoints when just 2 will do?
4) Last, but not least, this thread was about people sharing their ways of doing things. Someone have might used some method for months/years never knowing that it could be done better&faster.
If you don't like people giving you helpful advice, buzz off. But by the looks, you are the one who should seriously learn how to do things faster.
Have a nice day.
1) Are you talking to everyone who has replied to this forum or to one person and if, who?
2) The faster the presets run the more enjoyable they are, besides it's more than just 0.<insert ridiculous large ammount of zeros>1 frames, example the gradients work a lot faster when you use different methods. And the static texture for a 3D movement or likes saves up huge ammount of fps if it is only rendered once per N beats. I made a preset with the static texture and the framerate difference between render-per-N-beat and render-all-the-time is incredibly huge, on my 266mhz pentium it was about 8 fps.
3) Everything & Anything can & should be optimized. Or do you draw a static single colored ssc line with 800 numpoints when just 2 will do?
4) Last, but not least, this thread was about people sharing their ways of doing things. Someone have might used some method for months/years never knowing that it could be done better&faster.
If you don't like people giving you helpful advice, buzz off. But by the looks, you are the one who should seriously learn how to do things faster.
Have a nice day.
I've done #3.
It almost got out, then Unconed saw it and I fived it.
It sped up the preset a lot.
It almost got out, then Unconed saw it and I fived it.
It sped up the preset a lot.
This is a trick that can save more than 100% fps.
When you need more sinchronised scopes shaped the same you can make a counter and copy this scope to several locations.
Example:
init:
n=500
frame:
t=t-0.05;u=0;
point:
u=u+1;u1=u%5;
d=i/5;r=t+i*3.14159*4;x=cos(r)*d;y=sin(r)*d+(u1+0.5)/5*2-1;
This will create 1 spiral scope and place it at u1/5*2-1 locations, u is a counter and equals the value of a point, u1 equals:
0 for u being 5,10,15,20,...
1 for u being 6,11,16,21,...
2 for u being 7,12,...
3 for u being 8,13,...
4 for u being 9,14,...
For a more complex use of this see the attachment. The preset calculates the whole 3D rotation thing, music responce and scope shape only once for all of the cn(6) columns.
Sorry for the shity explenation but i find it hard to express myself in english. 🙁
When you need more sinchronised scopes shaped the same you can make a counter and copy this scope to several locations.
Example:
init:
n=500
frame:
t=t-0.05;u=0;
point:
u=u+1;u1=u%5;
d=i/5;r=t+i*3.14159*4;x=cos(r)*d;y=sin(r)*d+(u1+0.5)/5*2-1;
This will create 1 spiral scope and place it at u1/5*2-1 locations, u is a counter and equals the value of a point, u1 equals:
0 for u being 5,10,15,20,...
1 for u being 6,11,16,21,...
2 for u being 7,12,...
3 for u being 8,13,...
4 for u being 9,14,...
For a more complex use of this see the attachment. The preset calculates the whole 3D rotation thing, music responce and scope shape only once for all of the cn(6) columns.
Sorry for the shity explenation but i find it hard to express myself in english. 🙁
My (and most everyone who doesn't depend on El-Vis's engine) 3D code is several FPS faster than El-Vis's, and it's a whole lot more user friendly. Also, for those who didn't know: using zs=sqrt(maxdistance) projects the object so it is always inside the window. To find the maximum distance from the center of any object to a point on the object, use this method: For any variables (e.g. i and v), assume they are as high as they can go (e.g. i=1, v=1). Then simplify all your calculations. For example:
(tpi=acos(-1)*2=2*pi)
r=i*tpi;
x1=sin(r); y1=cos(r); z1=v/4;
r=1*tpi=tpi;
x1=sin(tpi)=0; y1=cos(tpi)=1; z1=1/4=0.25;
Now, find maxdistance like this:
sqrt(x1*x1+y1*y1+z1*z1)=sqrt(0*0+1*1+0.25*0.25)=sqrt(1.125)
So for the example scope, zs should equal sqrt(sqrt(1.125)*2)=pow(4.5,0.25).
If you want the scope to be slightly inside the frame, use a higher zs. If you want it to be slightly outside the frame, use a lower zs.
(tpi=acos(-1)*2=2*pi)
r=i*tpi;
x1=sin(r); y1=cos(r); z1=v/4;
r=1*tpi=tpi;
x1=sin(tpi)=0; y1=cos(tpi)=1; z1=1/4=0.25;
Now, find maxdistance like this:
sqrt(x1*x1+y1*y1+z1*z1)=sqrt(0*0+1*1+0.25*0.25)=sqrt(1.125)
So for the example scope, zs should equal sqrt(sqrt(1.125)*2)=pow(4.5,0.25).
If you want the scope to be slightly inside the frame, use a higher zs. If you want it to be slightly outside the frame, use a lower zs.