PDA

View Full Version : SS Help

MrGabberPants
11th November 2003, 07:48
Ok, i is a line from zero to one, but how do you make a multi point line that changes directions at any given point???

UIUC85
11th November 2003, 07:50
HUH!?

sidd
11th November 2003, 08:17
i think i know what you mean.... This isnt very tricky, you should try playing around with it yourself before asking here. But still, we are happy to assist. Anyways...

The easiest way to do what you are talkng about is to make a scope that only has the amount of points that you need to make your shape. Then, you just count the point you are up to (in the per point code), and specify it a position.

Try doing this:

-------------
init: n=5

per frame: p=0

per point:
p=p+1;

x=equal(p,1)*-0.5
+ equal(p,2)*0.5
+ equal(p,3)*0.5
+ equal(p,4)*-0.5
+ equal(p,5)*-0.5; //this is all one line of code

y=equal(p,1)*-0.5
+ equal(p,2)*-0.5
+ equal(p,3)*0.5
+ equal(p,4)*0.5
+ equal(p,5)*-0.5;
---------------

you can just copy and paste each of those into the appropriate superscope code box, and youll find that it makes a square. (make sure "draw as dots" isn't ticked)

The variable 'p' is used to count which point you are up to. And it is reset to 0 every frame so that it doent just keep on going over time.

Then you set the position according to what number p you are up to.

simple as that.

/edit
just a side note, you can change i all you want aswell. 2*i-1 is very commonly used, as it stetches i from -1 to 1, which are the boundaries of the avs screen on both axes.

you could manipulate i on both axes by doing this sort of thing in the per point section:

y=if(below(i,0.5),i,0.5);
x=if(above(i,0.5),i,0)

you'll see that the line changes direction at the half way point of i.