- AVS
- making a small 2-d ball
Archive: making a small 2-d ball
Karnov
20th August 2002 04:03 UTC
making a small 2-d ball
id like to make a small circle that follows a superscope's bottom position
here is my SS as is
Code:
-------------------------
init: n=1500
on beat:
per frame: t=t-0.05
per point: d=i+v*0.2; r=t+i*3.14159*4; x=v; y=-i*60
-------------------------
and id like a little circle that follows the bottom end of this "worm"
(if at all possible; please just offer "hints" or a "guide" to doing it; instead of the raw code; that is no fun y i dont learn anything
Karnov
20th August 2002 05:08 UTC
here is an example in avs form
(btw; i havent gotten permission to use the lame curve yet; but i hope unconed wont mind?? :( )
here; i want the middle SS (the one in the middle; the small one) to be a ball; but i cannot figure out how to do that without manipulating the x variable
if manipulate the x variable it will not follow the two lines!
i really need help here
ok; i am going to bed
i hope the AVS fairy instills an idea in either my or your head to solve the problem
thanks everyone
damn
there should be a sleepy smilie :)
UnConeD
20th August 2002 10:48 UTC
1) A Replace/Replace effect list does nothing. Move everything outside it.
2) The verticallish superscopes have 4000 points??? The code contains:
y=-i*60
And as 'i' ranges from 0 to 1, it means you're drawing points in the y range -60 to 0. The AVS window only goes from -1 to 1 in both x and y. So 98.3% of those 4000 points are invisible.
3) I don't mind you using the Lamé curves, but you should at least change the sound-response. I just whipped up a quick decaying radius based on volume... (m variable)
4) My code is not optimized. The 'a' and 'b' are used to control the shape theoretically, but practically you can just modify the end coordinates with a constant.
Karnov
20th August 2002 16:42 UTC
thanks for all the help; i appreciate it; although i am not sure how to optimize (i understand what you are saying; but i do not understand which constant to use)
(i use replace/replace to sort things (i am pretty anal retentive) and it makes it easy to just disable that effectlist if i only want to work on a particular portion of my AVS
UnConeD
20th August 2002 17:03 UTC
An alternative to effect lists for grouping effects (though not so handy) is using "misc/comment" to separate them.
You can also use AVS comments to label some components:
Any character with ASCII code >127 will mark the beginning of a comment. All comments end when a ';' is encountered (so comments can span multiple lines). E.g.
a=cos(b);
¤ This is a comment;
c=atan2(d,e);
To type a character with code xxx, hold down ALT and type the number "0xxx" out on the numerical keypad:
hold ALT - 0 - 1 - 6 - 4 - release alt
will give you '¤'. Two digit numbers only need one leading 0 too: ALT-065 is an 'A'.
Btw I think you misunderstood my "cache constant expressions" code.
Suppose 'angle' is a constant, and you're using its sin, you don't need to actuall enter the since of angle as a numerical value, but just calculate "sin(angle)" in AVS once.
For example instead of using acos(-1) for 'pi' in your scope-point code, just declare "pi=acos(-1)" once in the Init section.
Karnov
21st August 2002 02:09 UTC
ok; i think i understand what you are saying; for the most part anyways :)
however; i cannot figure out this:
how can i manipulate the sound-response of the lame curve? i cannot figure out how to manipulate the 'm' var w/out making the cirlce incomplete at all times
i am a totally n00b AVSer and i still cannot figure out how to draw a circle with one(1) superscope
i know it is possible
but i cant figure it out
not enough math classes
not enough mad logic skillz
and i feel so dumb not being able to draw a freaking circle; plz help
UnConeD
21st August 2002 04:09 UTC
You need to use one 'm' value and use that across all 8 superscopes. The curve is not drawn optimally though, it could easily be packed in one large scope.. like this:
init:
n=100;tpi=acos(-1)*2
frame:
m=getspec(0,0,0)*.15+m*.85;p=2/(m*3+.1)
point:
r=i*tpi;x=cos(r);y=sin(r);
x=pow(abs(x),p)*sign(x)*.9;
y=pow(abs(y),p)*sign(y)*.9;
m is now like before... it's converted into p to adapt to this method of drawing. Watch out you don't get a division by zero in 'p' though.
Karnov
21st August 2002 18:55 UTC
ok; that makes a lot more sense to me than 8 seperate superscopes
thank you; i hope this preset will eventually be cool
but; if you download it you will see that the small circle doesnt move
and therefore looks stupid
could u please tell me how to make it move along with the bottom of the 2 long superscopes
(im guessing i use the perframe and the 'v' variable; but i cannot figure it out)
(oh and unconed; thx for the kickass tutorial on superscopes and all the help you have been giving me)
(oh yeah;(i like paraensythsis:)) how do you like the name :))
Karnov
21st August 2002 19:21 UTC
here is the avs
here
Karnov
27th August 2002 03:53 UTC
man; ive been toying with this for almost a week
i can NOT get it to work;
the ball just wont bounce to the beat and still be a ball :(
it is very frustrating:mad: :mad: :mad:
i really need someone to help me out here
thank you a lot:up:
Jaheckelsafar
27th August 2002 04:19 UTC
Quick, dirty, and probably not right, but it it close?
Karnov
27th August 2002 22:10 UTC
THANK YOU!!
damn
i cant believe u can do that in only one SS
damn
damn
thank you and good job
thanks:up: :up: :up: :up: :) :) :) :up: :up: :up:
Jaheckelsafar
28th August 2002 05:16 UTC
Umm... no prob? :)
You understand how it works alright, or are you good with that?
Karnov
28th August 2002 22:17 UTC
thank you; it makes sense now; im surprised how easy it was
thank you