Archive: A curiosity


3rd May 2005 12:41 UTC

A curiosity
If you make a superscope to render a circle of radius n, then you place a movement after it with the code d=n, shouldn't it produce a fullscreen circular gradient the colour of your superscope?

I can tell you that it doesn't, but it seems to me that logically it should. You are saying for every pixel the r value remains the same but the d is a constant. Any thoughts?


If you want to try it make a ssc

x=sin(i*$pi*2)*n;
y=cos(i*$pi*2)*n;

red,green,blue = whatever;

movement:

d=n;

except replace the n with a scale factor 1>n>0 (what it is shouldnt make a difference)


3rd May 2005 17:59 UTC

shouldn't this thread be in "troubleshooting"?

However, i know what you mean. Logically it really should work. I guess the problem is that ssc and movement use slightly different coordinates for the pixels (probably rounding errors).
If you have a radius of 0.5 for example, you can tweak the movment to d=0.49/d=0.505 etc. If you do so you'll see that sometimes there is a gradient made of a few points and sometimes there isn't anything. If you want to get this idea to work, you'd have to assign a slightly different value to d, depending on the segment of the circle. (and this crappy work-around will probably only work for one specific resolution...)


3rd May 2005 18:21 UTC

It's because of aspect-ratio stuff. You have to correct for the aspect ratio, and it helps to use a fairly thick line. I got it to work once a long time ago.


3rd May 2005 23:10 UTC

movement code: (use rectangular coordinates)

r=atan2(y,x)
x=n*cos(r);y=n*sin(r)


4th May 2005 02:44 UTC

tomy had the same problem when he was makeing plasma containment. the important clue is that movements aspect ratio works so that d==1 in the corners. I wrote the code to sinc the ssc with it but it seems i lost it. And i cant remember how i did it from my head. it is in the plasma containment preset though (optimised by tomy):).


4th May 2005 03:07 UTC

polar movement is aspect-ratio corrected by default, while SSC is not

just use a simple linear SSC gradient
SSC:


frame:
n=w;
point:
x=2*assign(red,assign(green,assign(blue,i)))-1;
y=0;


movement(rectangular):

y=0;
x=r/$pi-1;
x=if(below(x,-1),x+2,x)

5th May 2005 10:39 UTC

er... okay I think a lot of people are missing the point, this isnt a problem I'm having that I need to solve, its a question of the way movements work.

I appreciate the aspect ration correction idea, it never really occured to me before but of course movements with polar coords aspect ratio correct by default. I'll have to try it out with an aspect ratio corrected superscope.


10th May 2005 02:45 UTC

the aspect ratio correction is rather fishy... better skip that and leave it alone :D


11th May 2005 08:34 UTC

the aspect ratio correction is a bit odd, like fsk said d==1 in the corners, so that if you do a one point ssc at x=0,y=0 and movement like d=if(above(d,1),0,d); you get a black screen with a dot in the middle.

The fix is pretty trivial, its just aspect correct as normal then scale everything by sqrt 2. I'm guessing this is what movement does internally, unless there are some ultra r33t voodoo hax in use...