![]() |
#41 |
Senior Member
Join Date: Nov 2002
Location: Australia
Posts: 190
|
Cant say I actually expected that !
|
![]() |
![]() |
![]() |
#42 |
Whacked Moderator
Join Date: Jun 2001
Posts: 2,104
|
Atero: if you don't have anything constructive to add to someone's question, shut up please.
VisualAgnosia: the superscope is just a drawing tool... you give it (x,y) coordinates on the screen with a color if you wish. So if you want to plot a graph of a function z=f(x,y), you'll first need to write code that traverses a grid of points in 2D rectangle, then calculates the z value for that point and then transforms the point with perspective. The best way to do this is not to use the 'i' counter in the superscope, but make your own counters. For example, this draws a simple 20x20 grid: init: n=400; per frame: t=t-.05;px=0;py=0;ct=cos(t);st=sin(t); per point: gx=(px/19)*2-1; gy=(py/19)*2-1; gz=-exp(-(sqr(gx)+sqr(gy))*4)*3+1.6; x1=gx*ct-gy*st;y1=gx*st+gy*ct; x=x1/(y1+3);y=gz/(y1+3); px=if(below(px,19),px+1,0); py=if(equal(px,0),py+1,py); red=if(equal(px,1),0,1);green=red;blue=red; There's a lot going on here, so I'll dissect it: First, we have 400 points on our grid, so we set n to 400. We'll be rotating the grid around, and we'll use 't' as the angle, which is decreased every frame by 0.05 radians. We also calculate the cosine and sine of the angle in the frame routine so we don't have to calculate it again every point, for speed reasons. We'll be traversing a 20x20 grid, and we'll store the current grid point in (px,py). px and py will take on the values 0-19 (20 points), first x then y. We start at (0,0). Per point, we transform (px,py) (between (0,0) and (19,19)) into (gx,gy) a point between (-1,-1) and (1,1). This is done by dividing by 19, multiplying by 2 and subtracting 1 (this piece can be done faster if we merge everything into one multiplication + add/sub, but this is easier to understand): code: Next, we calculate 'gz' based on gx and gy. I use exp(-(sqr(gx)+sqr(gy))) which is an exponential 'hump' the shape of the normal gaussian distribution. We multiply it by 3 and add 1.6 to make it fit in the AVS window. Next we rotate (gx,gy) by t radians, so that we get the point (x1,y1). We now use x1 as the x-coordinate, gz as the y-coordinate (z points up) and y1 as the depth coordinate (y points into the screen). We transform it into perspective by dividing (x,y) by z (plus a camera offset of 3). Now all we need to do is make sure (px,py) traverse the values 0-19. First, we check per point if px is smaller than 19: if so, we add 1. If px equals 19, we reset it back to zero. If px equals zero, we increase py by 1. This has the effect of traversion one row on the grid, and when we reach the end, we go to the next row and start over. code: And finally there's a little extra: AVS draws the superscope as one chain of line segments. This means that there will be a connecting line between the different rows, which is not what we want. So, we set the color to black for that certain line segment, and white for all the rest: if you use additive or maximum blending, the black lines won't show up. Tadaa... you now have a rotating plot. You could duplicate the scope and reverse the meaning of gx and gy in the second copy, that way you get a grid of lines. Make sure you reload the preset to synchronize the two scopes... (result is attached) So you see if you want to plot a graph, you have to do *everything* yourself. |
![]() |
![]() |
![]() |
#43 |
Senior Member
Join Date: Nov 2002
Location: Australia
Posts: 190
|
Awsome
Well I didn't expect that either ...
Thats quite a conecise explantation, Totaly get it..mind you I'm gonna print it out and study it like I have with 10 or so other wicked posts I've found. I'm getting a bit of a progression thing happening... from a couple days ago I'm getting more and more things undercontrol... still a long way to go. As it goes it's just a matter of sticking with it and "Dreaming new ideas" A bit of props for AVS --- Studing maths.. which I find interesting usually.. To use something with a straight away effect on visuals in such a dynamic flow of colour and music... Somehow's effected the time I spend studying by three fold --- weird??? Thanks for the effort again UnConeD. you've helped yet ANOTHER potential AVSer bridge another gap A note to other neewuubies like me have a look the load example superscopes, the code in there will give some indication as to the layout of the code. B4 you wrote this last post UnConeD I was resorting to the 3D layout they had going on in there. Peace VIsAG ![]() |
![]() |
![]() |
![]() |
#44 |
Major Dude
Join Date: Jan 2003
Location: Mumbai, India
Posts: 787
|
Tips and Tricks 2
Tuggummi started the first one, but that was long ago. I am sure there will be many new tricks (and Tips).
Just post them here, Here's one: when the amount of ssc's is quite large then cramp all of these into one.: eg: code: the trick is to draw everything in one ssc and then blacken out the point connecting the two objects. then use a maximum or addictive blend to hide the trick http://home.iitb.ac*****~shreyaspotnis |
![]() |
![]() |
![]() |
#45 | |
Major Dude
Join Date: Jan 2003
Location: Mumbai, India
Posts: 787
|
Quote:
i have already explained a bit of the code,but here's a detailed one. set cn=cn+1 in point, this will increase value of cn every point, an ideal way to count the number of the point. then use custom i values, this is what i figured out: incrementation value of i is inversely proportional to (n-1). so, if n=10; then after every point : i=i+1/(n-1); i.e i=i+1/9; i.e i=i+0.111111111111111111111111111111111. so if you draw a circle using i1 instead of i when cn is less than 10 and then draw some other object when cn>10, then blacken out the point joining the two objects, you get two separate objects. I hope you understood atleast some part of this, because I find it hard to explain things, especially complicated ones. if you cant figure out what this means, then maybe i will write an essay on this topic, after thinking hard and selecting my words ![]() http://home.iitb.ac*****~shreyaspotnis |
|
![]() |
![]() |
![]() |
#46 |
Major Dude
Join Date: Jan 2003
Location: Mumbai, India
Posts: 787
|
long essay
This one is all about the 2 in 1 scopes, I wrote all this when I was offline in notepad and then posted it here:
the previous two explainations just explained the concept, now here's the explaination of the actual code: ----------- Lets just consider the pixel part first because the beat and frame part is just for the movement of the scope. here's the code for the ssc: some variables required at init ![]() ![]() n=1000;a1=1/(499-1);vrem=n/10;pi=acos(-1);tpi=acos(-1)*2; (I will explain their use later on) reset values per frame : cn=0;i1=0; pixel part: cp=bnot(cp); cn=cn+1; i1=i1+a1; colc=bnot(equal(cn,501)); trans=above(cn,500); v1=if(bnot(cn%vrem),v,v1+abs(v/10)); d=if(cp,1+v1*0.2,.98); th=t+i1*tpi; outx=sin(th)*d; outy=cos(th)*d; inx=bnot(cp)*sin(th)*.3; iny=bnot(cp)*cos(th)*.3; x=if(trans,outx,inx)+ox;y=if(trans,outy,iny)+oy; red=colc;green=colc*.5;blue=0; explaination: 1) value of cp swaps beetween 1 and 0 every point. this is basically used to make solid scopes. eg:- when we multiply x and y with cp, and when a) cp=1, then x=x and y=y b) if cp=0 then x=0 and y=0. So, after every alternate point, the co-ordinates of the next point are (0,0). so, when we render the scope as lines, the entire part is filled with lines and we get a solid scope (provided the no of pts (n) is quite high) 2) cn:- this is the number of the point drawn. it is reseted to 0 every frame. 3) i1:- Custom i value. i1 is incremented by a1 every point. value of a1 is 1/(499-1). ie. 488. ie.0.0208333... 4) colc:- used for hiding the point which connects the two objects. colc=bnot(equal(cn,501)); So, when cn=501, bnot(equal(cn,501)) will return 0 else it will retun 1 cn is the number of the point. bu assigning rgb values to colc, the values for the 501th point will be 0 and for the other points will be 1. 5) trans:- no connection with its name and its values. I too dont remember why I used such a variable name. trans=above(cn,500); this will return 1 if cn is above 500, else it will return 0. (use explained later). 6) v1: Custom v value. v1=if(bnot(cn%vrem),v,v1+abs(v/10)); if cn is divided by vrem(n/10 i.e 1000/10 i.e 100) and the remainder is zero ( vrem is a factor of cn) then return v else return v1+abs(v/10); In short v1 is used for the waves created in the outer circle. whenever vrem is a factor of cn, then value of v1 will jump to v ( i.e after every 100 point value of v1 will be v), else it will be v1+abs(v/10), the will create the normal waves. 7) d is distance for the outer circle. this will swap beetween .98 and 1+v1*.2 as cp swaps beetween 1 and 0. d=if(cp,1+v1*0.2,.98); 8) th:- angle ( usually r ) th = t+i1*tpi; we have used cutom i value, so at the start i1=0 and at the end it is roughly 2. this is because we want to draw basically 2 circles. 9) outx=sin(th)*d; outy=cos(th)*d; the outer circle. conversion of polar coords into rectangular coords. 10) inx=bnot(cp)*sin(th)*.3; iny=bnot(cp)*cos(th)*.3; the inner circle (d=.3). value swaps beetween 0 and sin(th)*.3 or cos(th)*.3 for the solid fill effect. 11) x=if(trans,outx,inx)+ox; y=if(trans,outy,iny)+oy; trans: trans=above(cn,500); so, if cn<500 draws the outer circle, else draw the inner circle. 12) red=colc;green=colc*.5;blue=0; colc: colc=bnot(equal(cn,501)); if cn=501, then red=0; green=0;blue=0; if cn!=501 then red=1; green=.5;blue=0. this is for the orange colour. finally, i did it. hope you understand this, I havent explained the movment part because it is all normal and basic stuff. this is the preset I used the scope in: found in my first pack. btw. good way to increase posts ![]() http://home.iitb.ac*****~shreyaspotnis Last edited by shreyas_potnis; 14th March 2003 at 13:58. |
![]() |
![]() |
![]() |
#47 |
Major Dude
Join Date: Jan 2003
Location: Mumbai, India
Posts: 787
|
rovastar did a good job here, merged the two threads, Thanks.
edit: What about converting this thread into a sticky? can we do that? http://home.iitb.ac*****~shreyaspotnis |
![]() |
![]() |
![]() |
#48 |
Forum King
|
I was about to tell you to use the edit button until I realized that these posts have some time separating them. Yay for Rovastar, someone listened to my request!
![]() |
![]() |
![]() |
![]() |
#49 |
Major Dude
Join Date: Jan 2003
Location: Mumbai, India
Posts: 787
|
me too sent a private message to him!
![]() and what about the sticky? http://home.iitb.ac*****~shreyaspotnis |
![]() |
![]() |
![]() |
#50 |
Major Dude
Join Date: Jan 2003
Location: Estonia.
Posts: 851
|
good idea i must say, i like it!
Phi = (1+sqrt(5))/2 |
![]() |
![]() |
![]() |
#51 |
Forum King
|
Good, it's stickied now. Here's a tip for AVS n00bs: Don't submit your packs to winamp.com without first posting them here. We will give you a lot of constructive criticism and you can then fix your presets to make them even better. And beware the Atero.
|
![]() |
![]() |
![]() |
#52 |
Major Dude
|
Actually, it's more like check the forums for your question, doublecheck, triplecheck, quadruplecheck, and pentuple check for it before posting a new topic about your question or face the wrath of Atero (And the rest of the regulars dogpiling on you)
[soon to leave, sirs] |
![]() |
![]() |
![]() |
#53 |
Major Dude
|
*NOT CHECKED FOR REPEATED ENTRIES*
Custom inversion : White SSC in an effect list, XOR output. Any other white surface will do. AVS Lingo : SSC - Superscope DM - Dynamic Movement DDM - Dynamic Distance Modifier DS - Dynamic Shift MP - Moving Particles Convo Filter (Or just plain convo) - Convolution Filter Fast Brite - Fast Brightness (There are more, figure out yourself) Chroming : Chroming is changing the spectrum from 0...255 into 0..255...0 where 128 is now 255 - So it filters out anything too white. It can be done in several ways : -Effect list - Fast brite - Replace input, SubBlend2 output, another fast brite outside. -Buffer save, clear screen, 3 effect lists. One colormap for each list, additive blend for each list (except for the top). Each taking different color, with buffer restore on top of them. Change the white into the corresponding colors, drag them to middle. Add a black in the end. (SLOW, too much work, just saying it) -List (Replace input, max output) with invert in it, then an invert (outside the list) and a fast brite. -Jheriko's multi filter. Fastest. Rotation Delay : (Copied directly from fsk's guide. For the preset in action, go to fsk.deviantart.com, galleries, and then "Zvezda") rotation dellay init: effect=25 on beat: g=getosc(0,0,0)/15 per fr.: rz1=rz1+g; srz1=sin(rz1)/10; rz2=rz2+srz1; -------------------------------------------------------------- usualy you just use the rz1 but in this case you have to put it thru another sin to make the changes in the rotation soft (dunno how to put it otherwise - remeber the first tentacle I sent you, it didn't have tis and it kinnda jumped on beat) per point: x1=i*1.6-.8; y1=0; dst=sqrt(x1*x1+y1*y1); ----------------------------------- The distance from center rz=rz2-srz1*dst*effect; ---------------------------------- this is the effect part srz1 is the current change in rotation, so if you aplly les (-) rotation to the points further away from the center (*dst) you get the desired effect ![]() cz=cos(rz); sz=sin(rz); ---------------- this needs to be in the per point. x=x1*cz+y1*sz; y=y1*cz-x1*sz That is it ![]() -- Shape Engines : Use point-by-point assigning (p=p+1 in pixel, p=0 in frame, and assign coordinates). Put in p%(points used in the shape) in place of the p in equal(p,n). Use p1=if(equal(p%(points used in the shape),1),p1+1,p1) in pixel and p1=0 in frame to assign numbers for the shape. -- Fix aspect ratio before posting your pack, or UnConeD will be angry at you. Don't do the normal getosc syncing, or Atero will be angry at you. Heck, he'll be angry at you anyways - The standard greeting. [soon to leave, sirs] |
![]() |
![]() |
![]() |
#54 |
Member
Join Date: Feb 2003
Location: Ozshtrayleeuh
Posts: 98
|
There is another way of syncing other than with getoscs or getspecs?
please explaino. Also.. There are some *hidden* coding paramerters for sscs and dms etc. exp(x) returnes the 'e' (the exponential constant) to the power of x. atan2(a,b) i really have no idea. and (for the true n00b) alpha=0..1 -alpha sets the level of alpha blending in a dm if the blend setting is activated. this is done per point, so that mixtures/grandients of input and output can be created. can also be used to add fog and/or cover 'uglyedge' syndrome for 3d scopes. But i wont get into that. If you can ray-trace, then i think you can work this out for yourself. also pi=acos(-1); cheers to whoever enlightened us on this one. (methinks steven) thats all i can think of for now.. Oh Yeah.. With SSC. Never restrict yourself to creating shapes strictly from x/y= some form of 'i'. This is a very restrictive mothod in some cases. eg. init-- t=0; s=0; n=64 perframe-- t=0; s=0 perpoint-- s=if(equal(t,8),s+1,s); t=if(equal(t,8),0,t+1); x=s/8; y=t/8 this should creat a 8x8 dot grid, but i cant test it on this comp so correkt me if im wrong. use colour coding to blacken the bits where lines cross over screen. |
![]() |
![]() |
![]() |
#55 |
Major Dude
|
AVS Axer :
Exp(x) and atan2(a,b) are already known, alpha is well known, pi is already a basic knowledge. Oh, and your code is wrong (I didn't test, so not 100% sure). 1. T is never 8, so there is never any increase of t or s, so the counter won't work. 2. The x will just draw across the screen, so the correction should be x=s/8-t+1; [soon to leave, sirs] |
![]() |
![]() |
![]() |
#56 |
Senior Member
|
Heaven forbid that any newbie actually looks at this thread, cause if they do they will be completely overwhelmed.
My best advice is to not go into Whacko AVS or El-vis's stuff & try to pick apart how the hell those codes work. First go in, & try some very simple codes. Then check out other presets with very simple codes and see how they work. I think most of my stuff is pretty easy, I don't use too many varibles & other crap. (shameless self promotion). All in all, start out small & build from there. |
![]() |
![]() |
![]() |
#57 |
Member
Join Date: Feb 2003
Location: Ozshtrayleeuh
Posts: 98
|
hey nic01.. i didnt mean they arnt well known.. they just explained in the program. so newbs may not know about them
|
![]() |
![]() |
![]() |
#58 |
Major Dude
Join Date: Jan 2003
Location: Mumbai, India
Posts: 787
|
n00b mus be quie happ wih all his suff
http://home.iitb.ac*****~shreyaspotnis |
![]() |
![]() |
![]() |
#59 | |
Major Dude
Join Date: Feb 2002
Location: Leipzig / Germany
Posts: 859
|
Quote:
|
|
![]() |
![]() |
![]() |
#60 |
Forum King
Join Date: Dec 2002
Location: Manchester
Posts: 6,470
|
This isn't supposed to help anyone in particular, just anything that may be useful to anyone goes in here.
![]() |
![]() |
![]() |
![]() |
#61 | |
Major Dude
Join Date: May 2001
Location: somewhere else
Posts: 1,278
|
Quote:
powered by C₈H₁₀N₄O₂ |
|
![]() |
![]() |
![]() |
#62 |
Senior Member
|
you know what, I may not be a regular here at the forums, but I've been AVSing for 2 years now, & I'm just baffled by all those equations & whatnot.
when I think 'tips & tricks" i don't think multi-line formulas for some complicated effect. alright, enough bitching. |
![]() |
![]() |
![]() |
#63 |
Forum King
|
So then make your own tips and tricks for aesthetics. I would, but I'm not that good at aesthetics.
|
![]() |
![]() |
![]() |
#64 |
Senior Member
|
here I am with my foot in my mouth. I'm looking for some code that would treat a DynMove kinda like a basic sprite (if that makes sense, I'm no good with programming talk). All I want this DM to do is move around in a 3-D environment: move up & down, left & right, near & far. I tried looking here, but nothign really popped out. Does anyone have a uncomplicated way of doing this?
|
![]() |
![]() |
![]() |
#65 |
Major Dude
Join Date: May 2001
Location: somewhere else
Posts: 1,278
|
hmm...I didn't know there were more than one flavors of Sprite
![]() So you want to move the AVS around and zoom in and out? That's very easy: frame: Rectangular coordiantes on code: of course, this will not handle rotation...if you want that, there was a post a while back. If you want to move a single object around against a static background, then you need to synchronize SSCs. This can be achieved by using a pseudorandom number generator. (search the forums for synchronzing superscopes, there will be a much better explanation than I can do here). powered by C₈H₁₀N₄O₂ |
![]() |
![]() |
![]() |
#66 |
Forum King
|
Well. As long as your sprite has a black border we can do this one fine with some cheaty psuedo 3D code. Here is a simple dm that I quickly wrote to demonstrate this.
Per Frame: dz=sin(t)+1.2; dx=cos(t); dy=sin(2*t); t=t+0.01; z=1/(dz*0.5); Per Point: x=(x+dx)*z; y=(y+dy)*z; This works fine z for co-ordinates strictly greater than zero. Here dx, dy and dz represent the displacement of the sprite in the varying axes. A gridsize should be set for this, preferably large since it has to shrink the sprite sometimes. Set wrap to 'off' and we are done. If you want to draw the sprite over a background then simply chuck it in an effect list and use additive blending. Unless you want your sprite to rotate in 3D too then this should be enough. |
![]() |
![]() |
![]() |
#67 |
Major Dude
Join Date: Jan 2003
Location: Mumbai, India
Posts: 787
|
Conversion of polar co-ords. into rectangular ones and vice-versa:
to convert polar co-ords. into rectangular ones, use: x=sin(r)*d y=cos(r)*d to convert rectangular co-ords. into polar ones, use: d=sqrt(sqr(x)+sqr(y)) r=atan2(x,y) I hope I am right, correct me if I am not. I can explain, how d=sqrt(sqr(x)+sqr(y)) works. code: NOte: my first experiment without smiley's *I smile* http://home.iitb.ac*****~shreyaspotnis |
![]() |
![]() |
![]() |
#68 |
Forum King
|
You just tried making that way too difficult.
first off: x=d*cos(r) y=d*sin(r) you can get this merely by looking at the triangle. R is the angle and d is the hypotenuse(sp). Simple trig tells you that cos(r)=x/d sin(r)=y/d so those two equations are easy to derive. then, using pythagorean theorem d^2=x^2+y^2 Also simple. and then tan(r)=y/x simple again. |
![]() |
![]() |
![]() |
#69 |
Major Dude
Join Date: Feb 2002
Location: home
Posts: 1,318
|
Going up 2 posts here...
The grid size in a DM won't affect quality unless you're trying to bend the picture. Full pic zooming and rotation will only be slowed down by a larger grid size. That and I like to reduce the movement speed when zoomed out. To do so, multiply the move values by the inverse of you zoom. Now enough out of me. Stoke me a clipper. I'll be back for Christmas. - Arnold Rimmer Red Dwarf |
![]() |
![]() |
![]() |
#70 |
Forum King
|
A couple tricks I'm playing around with...
The classic "floating squares" effect: EL (ignore, every other pixel) .Invert [Optional: EL (ignore, evey other line) .Invert] Rotozoomer can be enhanced with random coloring of the squares using this method: Invert Grain EL (ignore, multiply) .EL (ignore, every other pixel) ..Invert .[Optional: EL (ignore, evey other line) ..Invert] Colormap Rotozoomer Also, I've discovered a sort hack to make a cycling color palette using Colormap. It's rather cumbersome and it's not perfect, but here's how it works: Custom BPM - invert Custom BPM - skip x beats Color map The color map must have several rotating positions of a cyclic palette, and be set to "Onbeat cycle". A nice sort of hue shifter can be created this way. It'd be rather neat if we could actually wheedle a real cycler out of ucd, with dynamic cycle position 'n' stuff.... ![]() "guilt is the cause of more disauders than history's most obscene marorders" --E. E. Cummings |
![]() |
![]() |
![]() |
#71 |
Major Dude
Join Date: Jan 2003
Location: Mumbai, India
Posts: 787
|
great, would be better if you would post the AVS file
http://home.iitb.ac*****~shreyaspotnis |
![]() |
![]() |
![]() |
#72 |
Member
Join Date: Feb 2003
Location: Ozshtrayleeuh
Posts: 98
|
somone asked how atan2 works:
in case you didnt already know.. asin, acos and atan are the inverse functions of sin cos and tan. dont be confused however and think that asin(sin(x)), will neccessarily return x. Thnk of a circle and acknowledge that no matter how many times you got around the circle, sin(x) will always be the same at the same point of the circle. Now imagine that x is more than 2*pi (the circumference), this is just like going around a circle more than once, so all the values will be the same. The trouble with asin, acos and atan is that they do not even return the right values of x all the way around a circle!! Dont get me wrong, they have their uses. Consider sin(x) again, this finction will return 0 in two different positions while 0>x>2pi. one at 0 and one at pi. Now you can see that asin(sin(x)) will definatly not return the right values of x, because sin(x) has a pattern, but x does not. In reality, asin(sin(x)) will return x for only the first quadrant, After that x is reset to 0 at the start of every new quadrant. And with these rules. First quadrant: Asin(sin(x)) = x second quadrant:Asin(sin(x)) = 2pi-x third quadrant: Asin(sin(x)) = -x fourth quadrant:Asin(sin(x)) = -2pi+x Look at a unit circle or play around in avs and youll get how this works. Try this in a superscope: y=atan(tan(i*acos(-1)*2))/5; x=i/5 and try replacing atan and tan with asin and sin. etc. To counter this, atan2 was invented.. pretty much you input two coordinates of a point (x,y) and it does something similar to atan(x/y) but it acknowledges that they are coodinates of the same point and works it out in some clever way that i dont yet know. So, atan2(x,y) returns the angle of the point x,y in radians from center (0,0). If you look at alot of code however, people in avs have tended to use atan2(x,-y). This is because the y axis in avs is fliped. In trig we start from the bottom and goto top. I dont know why.. It is also convention to start from the right at -1 and got anti clockwise around the circle.. (first quadrant is at top left). So i dont know why we arnt using atan2(-x,-y) but i wont argue because fsk and unconed use the other way, and they seem to know their shit. Correct me on anyof this please.. cause i could have easily have got confused. Oh, and if someone knew exactly how the function is calculated, it would be most helpful. Last edited by AVS Axer; 28th April 2003 at 07:28. |
![]() |
![]() |
![]() |
#73 |
Member
Join Date: Feb 2003
Location: Ozshtrayleeuh
Posts: 98
|
XOR blending mode was also asked about somewhere..
Sadly itsnot as simple as you would hope. Xor is computed at the binary level. So, each pixel has the compondents r,g,b (depending on how old your comp is ho ho.) And each r,g, or b, can be described as a binary digit. (or bit) (0000,0000). ok.. lets lets just look at one channel, say r. and just one pixel. we have A=0010,1010, B=0101,0111 dont wory about what those colours are, or even what those numbers are, i dont know either. For this demo, A is the old image, B is the blending image. A XOR B means the same as (A OR B)NOT(A AND B) in binary logic, 0 is false, 1 is true. so it will return "TRUE"(1) if a OR b are 1, but "FALSE"(0) if a AND b are both 1, and 0 if neither a OR b are 1. so: a-----=(00111010) b-----=(01010111) aXORb-=(01101101) you see now? This is applied to all colour chanels and the same to every pixel. Notice some things.. *if image A and B are the same, the whole screen would be black, *two completely different solid colours (different in all r,g and b), the whole screen would be white. *any identicle pixels would be shaded black Last edited by AVS Axer; 28th April 2003 at 11:00. |
![]() |
![]() |
![]() |
#74 |
Major Dude
Join Date: Jan 2003
Location: Mumbai, India
Posts: 787
|
some friend of mine told that XOR is used in encryption.
e.g if x XOR y = z then y XOR z = x ( thats what he told me) http://home.iitb.ac*****~shreyaspotnis |
![]() |
![]() |
![]() |
#75 |
Member
Join Date: Feb 2003
Location: Ozshtrayleeuh
Posts: 98
|
Well, xor is not just graphics, it is a logic operator just like AND, NOR, OR etc. It can be used in anything.
But i think your friend got that encryption idea wrong, i have also heard of it beign used for this, and i simply assumed that it uses the same binary xor method as mentioned above. |
![]() |
![]() |
![]() |
#76 |
Member
Join Date: Feb 2003
Location: Ozshtrayleeuh
Posts: 98
|
Well, as it often happens, i was wrong..
i looked at the idea more carefully and youre friend was right shreyas. One of the outcomes of the xor operation is that it can be inverted easily. yes, if x XOR y = z then y XOR z = x so you can decrypt z(the encryption) to get x(the original) so long as you have y (which acts as a sort of mask). This applied to avs. if you were to XOR blend imageA with imageB, you would get imageC you could then XOR blend image B with imageC and you would get youre original imageA back!!! wowee... i didnt know that untill shreyas pointed it out.. very clever, but not very useful... |
![]() |
![]() |
![]() |
#77 |
Whacked Moderator
Join Date: Jun 2001
Posts: 2,104
|
About atan2... you got one detail wrong. In a mathematical coordinate system, the angle for (x,y) with regard to the positive x axis is atan(y/x), not atan(x/y).
By the way, you can imagine atan2 to be the same as this, except that atan2 can also handle the cases where x and/or y is 0: alpha=atan(y/x)+below(x,0)*acos(-1); |
![]() |
![]() |
![]() |
#78 |
Member
Join Date: Feb 2003
Location: Ozshtrayleeuh
Posts: 98
|
Friendly edit:
By the way, you can imagine atan... (not atan2) |
![]() |
![]() |
![]() |
#79 |
Major Dude
Join Date: May 2001
Location: somewhere else
Posts: 1,278
|
Transparencies
do your 'background stuff'
add a replace buffersave to #1 do the 'over stuff' replace buffersave to #2 multiply --> infinite square invert effect list (ignore/multiply) ..buffer restore (replace) #1 [end effect list] buffer restore (max) #2 (there might be a better way, this is what I have found to work) powered by C₈H₁₀N₄O₂ |
![]() |
![]() |
![]() |
#80 |
Member
Join Date: Feb 2003
Location: Ozshtrayleeuh
Posts: 98
|
switches:
--------------- binary: sw=1-sw --------------- 'sw' will switch from 1 to 0 every time the code is run. Because it is binary, you can use simple maths to get ANY two numbers from this switch: sw2=sw*(difference between desired numbers)+(lowest desired number) Superscope example (use dots, not lines): sw=1-sw; y=getosc(i,0,0)*0.2+(sw-0.5)*0.5; x=2*i-1; ------------------------------------- Other Switches: t=t+1; sw=t%ns; Where ns is the number of switches.) --------------------------------------- sw will progress through 0 to ns and then loop. Superscope example: t=t+1; sw=(t%7); v=getspec(sw/7+i/7,0,0); x=v*0.2+((sw*0.2)-0.6)*1.5; y=2*i-1; |
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|