Go Back   Winamp & Shoutcast Forums > Visualizations > AVS

Reply
Thread Tools Search this Thread Display Modes
Old 24th April 2003, 13:57   #1
Deamon
Major Dude
 
Deamon's Avatar
 
Join Date: Nov 2002
Location: Arnhem, the Netherlands
Posts: 927
Tips & Tricks 2 -- Beginners and Intermediate Only

After watching the Tips & Tricks topic started by Tuggummi, I thought it was very useful for the more advanced AVS'ers here, but that NONE of the starters or lower-leveled AVS'ers would get anything of it. I read it, and understood the first 3 or 4 posts, and then everything became very hard.

Therefor this topic. It is (as well as the other Tips & Tricks topic) to share ideas and effects. I justified why I started a new one, and I hope that UnConed and Tuggummi etc. can keep the level low, and don't start posting their great and cool codes, because the newbies (like me) can't understand them anyway.

I hope you all understand why I posted this, and that some good (but easy ideas) come up .

Greets,

Deamon
Deamon is offline   Reply With Quote
Old 24th April 2003, 13:58   #2
Deamon
Major Dude
 
Deamon's Avatar
 
Join Date: Nov 2002
Location: Arnhem, the Netherlands
Posts: 927
So here we go,

In Superscopes, use "getosc(i,0,0)" instead of V, keeps the speed up a bit. I'm not quite confident if it is exactly the same, but I haven't noticed any differences yet.

.:HyperNation @ winamp:. .:DeviantArt:.
Thermal is now available for download at DeviantArt.
Deamon is offline   Reply With Quote
Old 24th April 2003, 14:00   #3
Deamon
Major Dude
 
Deamon's Avatar
 
Join Date: Nov 2002
Location: Arnhem, the Netherlands
Posts: 927
Dynamic movement:

d=d/(y*2.2+3)*2

Makes an easy surface. Rotation can be added under this line, movement is easiest in x and y coords in another dynamic movement above it.

.:HyperNation @ winamp:. .:DeviantArt:.
Thermal is now available for download at DeviantArt.
Deamon is offline   Reply With Quote
Old 24th April 2003, 14:06   #4
Deamon
Major Dude
 
Deamon's Avatar
 
Join Date: Nov 2002
Location: Arnhem, the Netherlands
Posts: 927
The if(...) explained in Visual Basic style:

if....then....else

if(condition,then,else)

condition = the condition you want to "if". This requires two variables, compared with the words above, below and equal.

then = if the condition is met, execute this piece of coding.

else = if the condition is not met, execute this piece of coding.

example:

t=if(above(t,10),1,t)+0.05;

explanation

if t get's bigger than 10, set t to 1, else stay t. After this check 0.05 is added to t.


PS.

My excuses for not using edit, I only noticed it now :P .

.:HyperNation @ winamp:. .:DeviantArt:.
Thermal is now available for download at DeviantArt.
Deamon is offline   Reply With Quote
Old 24th April 2003, 15:47   #5
Raz
Forum King
 
Raz's Avatar
 
Join Date: Dec 2002
Location: Manchester
Posts: 6,470
I will show you how to make a moving particle, one of the main components of early presets through a superscope because i'm sick of seeing moving particles in noob presets. There are lots of ways to do this in superscope but this is one of the easiest ways:
First lets draw the actual spiral so that it just sits there in the center of the screen (red text just to explain)
Superscope:
Init:
n=800; pi=acos(-1); ("n=" sets the number of points the scope will draw. "pi" is just setting a variable, this can be anything you want as long as it starts with a letter. "acos=(-1)" this calculates pi in avs so i have set a variable to calculate pi. When i insert this into the x or y part of the scope the variable will add pi to it)

On Beat:

Per Frame:

Pixel:
x=cos(i*pi*30)*i*0.1;
y=sin(i*pi*30)*i*0.1;
(the scope is calculated in the x and y tags only. You can put any variables calculated anywhere else in the scope in and they will become part of the equation if they have been done correctly. cos simply means the cosine of what is in the brackets directly in front of it. sin is the sine of the ........ i'm not entirely sure what i does but it draws lines now i * 3.14159... (pi has been set as a variable earlier in the scope and the scope reads it) *30 which means 30 *pi) again times by i makes the spiral. the ammount you times pi by calculates the density of the spiral. This means how many times does it go around before you get to the middle. The * 0.1 simply makes the entire thing 0.1 times the size it was before on whichever axis you times it by

There is a moving particle type dot in the middle of the screen now. Now movements. This involves setting more variables and uses of other avs tags. Now just movements on the x axis:

Frame:
n=800; pi=acos(-1);

OnBeat:
rx1=rand(50)/50; (rx1 is again simply setting a variable. "rand" is an avs term, it simply means takes a random number from whatever is in the brackets to one. In this case, 50. "/50" divides the entire thing by 50, meaning the random between 0 and 50 is now between 0 and 1 but is split 50 ways.

Per Frame:
ax=ax*0.9+rx1*0.1; ax=ax simply means that ax= whatever ax was before plus whatever you continue in the equation. It's times by 0.9 meaning 9 out of 10 of the previous number generator then added the random number from on beat then made 1 out of 10 again.

Per Point:
x=cos(i*pi*30)*i*0.1-0.8+ax;
y=sin(i*pi*30)*i*0.1-0.8+ay;
this is simply what it was before except the x axis has the moving number generator added so the dot moves around to the number. add it to the y axis and take it off the x and the dot will move up and down instead of side to side. Use it on both however since it using the same random number generator it will move one dimensionally diagonally though. The easy solution is make another random generator. This simply means to copy the old one and change the variable names:

Frame:
n=800; pi=acos(-1);
OnBeat:
rx1=rand(50)/50; ry1=rand(50)/50;
Per Frame:
ax=ax*0.9+rx1*0.1; ay=ay*0.9+ry1*0.1;
Per Point:
x=cos(i*pi*30)*i*0.1-0.8+ax;
y=sin(i*pi*30)*i*0.1-0.8+ay;

This is just the same except there is a different random number generator moving the dot on the y axis which makes the dot zoom around to the beat. This means you can mess around with the movement of the scope and make your own random number generators and make it move however you want. Nifty aint it.

Another way to do it is just to make a textered dot. This means using the texer APE from UnConeD's whacko 6 (I think). This is simply the same movement method but you just draw a simple dot that zooms around and an image masks the dot. eg:

Frame:
n=1; this only needs one dot drawn because it is just a dot
OnBeat:
rx1=rand(50)/50; ry1=rand(50)/50;
Per Frame:
ax=ax*0.9+rx1*0.1; ay=ay*0.9+ry1*0.1;
Per Point:
x=0-0.8+ax;
y=0-0.8+ay;
the 0 just signifies where the dot is placed at first and the + shows by how much the dot should move

I hope that helps you a little and shows you that scopes aren't that hard and i hope it cleared up some things.

Raz is offline   Reply With Quote
Old 24th April 2003, 15:49   #6
Rovastar
Moderator
 
Join Date: Jun 2001
Location: London, England
Posts: 3,632
Send a message via AIM to Rovastar
I do not want another sticky!!

Remember the 'if' part is if condition does not equal zero then execute.

if(mybeat,123,321)

if mybeat <>0 then 123 else 321

it is quick then using the above etc and many newbis wil find it a quick step to learn.

FOr a more detailed explaination of the command I am sure there is a decent AVS resource that someone has done or else (Back to milkdrop) http://www.nullsoft.com/free/milkdro...horing.html#3f is ok although that version is still missing some. & doesn't work and atan2 exp etc are missing.

"Rules are for the guidance of wisemen and the obedience of fools"

Visuals - Morphyre www.Morphyre.com
Rovastar is offline   Reply With Quote
Old 25th April 2003, 00:37   #7
UnConeD
Whacked Moderator
 
UnConeD's Avatar
 
Join Date: Jun 2001
Posts: 2,104
This is definitely a beginner trick that belongs here... it's been published before:

When coding your own equations, you can leave comments to make it easier for yourself to remember what stuff does.

To place a comment in code, you can use any high-ascii character (like £, ù, µ, ©, __...) to open the comment, and end it with a semi-colon [;]
To type a high-ascii character (if you have none on your keyboard), hold ALT and then type 0 followed by a number from 128 to 255 on the numerical keypad.

E.g.:

x=cos(r)*d;y=sin(r)*d; £ This is a circle;

UnConeD is offline   Reply With Quote
Old 28th April 2003, 09:01   #8
Tuggummi
Bin King
 
Tuggummi's Avatar
 
Join Date: Mar 2001
Location: Finland
Posts: 2,173
A common mistake about how the rand() function works is that it gives you values from 1-N(N=defined rand value, i.e. rand(10)) randomly.

When it works a bit differently and some might say it's not logical.

So here is an example:

On beat:
rnd=rand(20)

This piece of code gives you not random values from 1 to 20, but instead 0 to 19, this is important when you need really specific values like multiplying a scope length for example. If you indeed want values from 1 to 20 you only need to write it like this:

rnd=1+rand(20)

The rand function still gives you values from 0 to 19, but it now always adds +1 to the whatever the result of the rand function is.

Makes sense?

Here is a superscope example:

Init
n=100

On beat
rnd=(5+rand(16))*0.1

Per Pixel
x=i*rnd-rnd*0.5 ;
y=v*0.3

Now we have a horizontal scope that vibrates on the y axis and randomly changes it's lengt on the x axis.

How it works?
First we have in the init section "n=100" , this just means how many points in the line there is so we will ignore that (it can be pretty much anything you want)

Then we have the rnd value in the on beat section. "Rnd" first sets 5 as the minimal value and the adds (+) randomly values from 0 to 15 into it (rand(16)). Then we just multiply the outcome with 0.1 so we get values from 0.5 to 2.0 (0.5,0.6,0.7...) randomly each beat.

Then we have the actual scope code which i have used to describe & show what it really does.

x=i*rnd-rnd

Where i*rnd first draws a line with the i function and defines the length with the rnd function. Then the -rnd*0.5 part just align's it to the center of the screen as the scope changes it size the center also changes so we need to use the rnd value also to align it to the center, we multiply it by 0.5 (same as dividing it with 2) and minus it.

y=v*0.3

Just makes it vibrate in the y axis (vertical vibration) , we multiply it by 0.3 to tone it down a bit.



And there it is, this should pretty much explain how the rand function really works.

Texer Resources

Im retarded... err i mean retired!
Probably both...
Tuggummi is offline   Reply With Quote
Old 28th April 2003, 09:54   #9
shreyas_potnis
Major Dude
 
shreyas_potnis's Avatar
 
Join Date: Jan 2003
Location: Mumbai, India
Posts: 787
Quote:
Originally posted by Deamon
So here we go,

In Superscopes, use "getosc(i,0,0)" instead of V, keeps the speed up a bit. I'm not quite confident if it is exactly the same, but I haven't noticed any differences yet.
well, getosc and the value of v are for totally different.
in short
v=getosc(i,0,0) is equivalent to v when put in per pixel

http://home.iitb.ac*****~shreyaspotnis
shreyas_potnis is offline   Reply With Quote
Old 28th April 2003, 18:51   #10
dirkdeftly
Forum King
 
dirkdeftly's Avatar
 
Join Date: Jun 2001
Location: Cydonia, Mars
Posts: 2,651
Send a message via AIM to dirkdeftly
no it's not. getosc(i,0,0) and getspec(i*something,0,0)*2-1 *approximate* v in ssc, i think it has some odd roundoff errors...or something

"guilt is the cause of more disauders
than history's most obscene marorders" --E. E. Cummings
dirkdeftly is offline   Reply With Quote
Old 29th April 2003, 08:08   #11
Deamon
Major Dude
 
Deamon's Avatar
 
Join Date: Nov 2002
Location: Arnhem, the Netherlands
Posts: 927
easy movement to try out (looks like tunnel effect):

d=sin(d);
r=r+0.05;

This was my first homemade movement

.:HyperNation @ winamp:. .:DeviantArt:.
Thermal is now available for download at DeviantArt.
Deamon is offline   Reply With Quote
Old 29th April 2003, 08:24   #12
Tuggummi
Bin King
 
Tuggummi's Avatar
 
Join Date: Mar 2001
Location: Finland
Posts: 2,173
Zooming & Rotating

How to use zooming and rotating in the movement with D & R (polar coords)

Well you zoom in D by multiplying D with a value of your choice

like this
d=d*0.75

This zooms the current screen closer (inwards) by 1/4 (0.75 out of 1 is 3/4)

another example
d=d*2

This zooms the current screen out_wards. It's pretty simple, basicly it doubles the distance NOTE: Using wrap will result in a pattern of the screen, but the distance still stays the same.


To rotate, you add values to the R value

like this
r=r+0.1

This will slightly rotate the picture counterclock-wise, using - instead of + will result in rotating the screen in clock-wise direction. It's as simple as that Use higher values instead of 0.1 to rotate more. You should also now that rotating the screen with a value that is 2*pi will result that the image will rotate 360 degrees




Now you have a go



[edit]
It seems the word o-u-t-w-a-r is forbidden, what the hell is that all about?
[/edit]

Texer Resources

Im retarded... err i mean retired!
Probably both...
Tuggummi is offline   Reply With Quote
Old 29th April 2003, 09:56   #13
shreyas_potnis
Major Dude
 
shreyas_potnis's Avatar
 
Join Date: Jan 2003
Location: Mumbai, India
Posts: 787
spiral static movement:

r=r+sin(d* no of swirles * pi * 2)*intensity

http://home.iitb.ac*****~shreyaspotnis
shreyas_potnis is offline   Reply With Quote
Old 29th April 2003, 18:59   #14
dirkdeftly
Forum King
 
dirkdeftly's Avatar
 
Join Date: Jun 2001
Location: Cydonia, Mars
Posts: 2,651
Send a message via AIM to dirkdeftly
actually, that movement is:
r=r+sin(d*swirls)*intensity
you don't have to get the 2pi in there at all. you can apply it to d as well:
d=d+sin(r*swirls)*intensity

when combining them, if you just use the two formulas together:
r=r+sin(d*rswirls)*rintensity;
d=d+sin(r*dswirls)*dintensity;
d is shifted using the already shifted r value. to fix this, save r before you shift it:
r1=r;
r=r+sin(d*rswirls)*rintensity;
d=d+sin(r1*dswirls)*dintensity;
it's a small fix, but it works. another fix is to zoom c instead of increment it:
r1=r;
r=r+sin(d*rswirls)*rintensity;
d=d*(sin(r1*dswirls)*dintensity+1);
this makes it so that the swirls aren't so stretched.

"guilt is the cause of more disauders
than history's most obscene marorders" --E. E. Cummings
dirkdeftly is offline   Reply With Quote
Old 1st May 2003, 21:10   #15
Deamon
Major Dude
 
Deamon's Avatar
 
Join Date: Nov 2002
Location: Arnhem, the Netherlands
Posts: 927
using if(above(....)...) is handy in d to alter d movements outside a ring instead of the whole view.

d=if(above(d,0.2),sin(x*x+y*y),d) creates a sort of ugly bubble on the preset.

Of course "below" works as well.

.:HyperNation @ winamp:. .:DeviantArt:.
Thermal is now available for download at DeviantArt.
Deamon is offline   Reply With Quote
Old 2nd May 2003, 09:48   #16
shreyas_potnis
Major Dude
 
shreyas_potnis's Avatar
 
Join Date: Jan 2003
Location: Mumbai, India
Posts: 787
well, no the correct one is:

r=r+sin(d*pi*no of swirles)*intensity.

well, you need to ,multiply by pi to get the desired number of swirles

http://home.iitb.ac*****~shreyaspotnis
shreyas_potnis is offline   Reply With Quote
Old 2nd May 2003, 21:11   #17
Deamon
Major Dude
 
Deamon's Avatar
 
Join Date: Nov 2002
Location: Arnhem, the Netherlands
Posts: 927
instead of using x and y in superscopes you can easily add the var zoom this way:

x1= ;
y1= ;
zoom= ;

x=(x1/(zoom+1));
y=(y1/(zoom+1));

x and y coordinates should be put in x1 and y1 now. The higher zoom is th further away the scope.

example:

r=i*pi*2; (pi=acos(-1) in init, presumably standard)
x1=sin(r);
y1=cos(r);
zoom=sin(t); (t=t-0.05 in frame, standard)
x=(x1/(zoom+1));
y=(y1/(zoom+1));

.:HyperNation @ winamp:. .:DeviantArt:.
Thermal is now available for download at DeviantArt.
Deamon is offline   Reply With Quote
Old 3rd May 2003, 09:57   #18
Deamon
Major Dude
 
Deamon's Avatar
 
Join Date: Nov 2002
Location: Arnhem, the Netherlands
Posts: 927
I have searched the forums, (and googled) for some explanation of 3D AVS'ing and rotation matrices, but I don't quite get it, could somebody please give a small explanation (preferably with example) on how to make 3D AVS'es?

Thanks on advance

.:HyperNation @ winamp:. .:DeviantArt:.
Thermal is now available for download at DeviantArt.
Deamon is offline   Reply With Quote
Old 4th May 2003, 04:03   #19
dirkdeftly
Forum King
 
dirkdeftly's Avatar
 
Join Date: Jun 2001
Location: Cydonia, Mars
Posts: 2,651
Send a message via AIM to dirkdeftly
shreyas: still wrong. you don't need pi at all, and there's no way to guarantee that you get the correct number of swirls, so it's all subjective anyway. it doesn't really even matter in the long run, unless you want to get the center points of the swirls to sync them with a scope, which you can do with some simple trigonometry.

"guilt is the cause of more disauders
than history's most obscene marorders" --E. E. Cummings
dirkdeftly is offline   Reply With Quote
Old 4th May 2003, 07:58   #20
Jaheckelsafar
Major Dude
 
Join Date: Feb 2002
Location: home
Posts: 1,318
3D AVS is reatively easy.

Give each point an x,y,z value. Make x = xval/zval and y = yval/zval.

Stoke me a clipper. I'll be back for Christmas.

- Arnold Rimmer
Red Dwarf
Jaheckelsafar is offline   Reply With Quote
Old 4th May 2003, 22:11   #21
dirkdeftly
Forum King
 
dirkdeftly's Avatar
 
Join Date: Jun 2001
Location: Cydonia, Mars
Posts: 2,651
Send a message via AIM to dirkdeftly
note that the camera is put in the exact center, which means if z is between -1 and 1, the camera will be looking at points behind itself (which is a bad thing). be sure to shift z forward before you apply the x=xp/zp; y=yp/zp; transformation.

"guilt is the cause of more disauders
than history's most obscene marorders" --E. E. Cummings
dirkdeftly is offline   Reply With Quote
Old 5th May 2003, 08:20   #22
Jaheckelsafar
Major Dude
 
Join Date: Feb 2002
Location: home
Posts: 1,318
True, forgot that. It's usually best not to have things go behind the camera; it can cause all kinds of funky lines. If a point goes behind the camera, the x and y values will be negative of what they are infront. You can set the colour to black a bit before the camera to avoid funky lines, but that won't work if your points are too far apart. Any colour changes affect only lines comming out of a point, not going in.

Stoke me a clipper. I'll be back for Christmas.

- Arnold Rimmer
Red Dwarf
Jaheckelsafar is offline   Reply With Quote
Old 5th May 2003, 08:33   #23
Phaze1987
Major Dude
 
Phaze1987's Avatar
 
Join Date: Jan 2003
Location: Lula The Sexy Empire
Posts: 916
Send a message via ICQ to Phaze1987 Send a message via AIM to Phaze1987 Send a message via Yahoo to Phaze1987
Tip - if you are a newbie and you want to start coding DON`T use movements with polar coordinates(d,r) and rectangular coordinates(x,y)ther.Learn to use rectangular first then polar then combine them.Trying to combine then not knowing what you are doing can provide some nasty effects...
Phaze1987 is offline   Reply With Quote
Old 5th May 2003, 09:32   #24
shreyas_potnis
Major Dude
 
shreyas_potnis's Avatar
 
Join Date: Jan 2003
Location: Mumbai, India
Posts: 787
the best wasy will be to add 1 or some number closer to it to avoid those lines(might even end up hanging or chrashing AVS)

http://home.iitb.ac*****~shreyaspotnis
shreyas_potnis is offline   Reply With Quote
Old 6th May 2003, 10:19   #25
Deamon
Major Dude
 
Deamon's Avatar
 
Join Date: Nov 2002
Location: Arnhem, the Netherlands
Posts: 927
Yep, I had AVS crashing once, and it is damn hard to get it back as well, cause it loads the last loaded prest everytime...horrible.

but x/z and y/z only causes zooming, right? (like my previous post)

.:HyperNation @ winamp:. .:DeviantArt:.
Thermal is now available for download at DeviantArt.
Deamon is offline   Reply With Quote
Old 6th May 2003, 15:23   #26
Jaheckelsafar
Major Dude
 
Join Date: Feb 2002
Location: home
Posts: 1,318
Yeah, but if each point has a different z value...

Stoke me a clipper. I'll be back for Christmas.

- Arnold Rimmer
Red Dwarf
Jaheckelsafar is offline   Reply With Quote
Old 7th May 2003, 12:53   #27
Deamon
Major Dude
 
Deamon's Avatar
 
Join Date: Nov 2002
Location: Arnhem, the Netherlands
Posts: 927
how do you accomplish that?

.:HyperNation @ winamp:. .:DeviantArt:.
Thermal is now available for download at DeviantArt.
Deamon is offline   Reply With Quote
Old 7th May 2003, 15:14   #28
Jaheckelsafar
Major Dude
 
Join Date: Feb 2002
Location: home
Posts: 1,318
Some kind of formula based on i, many if statements, or rotation around the x or y axes. There's a number of different ways.

Stoke me a clipper. I'll be back for Christmas.

- Arnold Rimmer
Red Dwarf
Jaheckelsafar is offline   Reply With Quote
Old 8th May 2003, 06:42   #29
Magic.X
Major Dude
 
Magic.X's Avatar
 
Join Date: Feb 2002
Location: Leipzig / Germany
Posts: 859
try to make up a simple on point z-val changing (maybe z=sin(i*asin(1)*4+t) and then change t per fram to give it a dynamic feeling. This should do it. If you got the main idea of how it is done, go further into it and try out more.


-=[The Ultimate VJ-Tool for AVS]=-

Hotlist 2.3 developement thread (old)
Magic.X is offline   Reply With Quote
Old 8th May 2003, 13:11   #30
Deamon
Major Dude
 
Deamon's Avatar
 
Join Date: Nov 2002
Location: Arnhem, the Netherlands
Posts: 927
and with z=sin(i*asin(1)*4+t) I use x=x/z and y=y/z? (btw. what does the code exactly mean? I can copy it, but then I wouldn't fully understand what I'm doing.)

.:HyperNation @ winamp:. .:DeviantArt:.
Thermal is now available for download at DeviantArt.
Deamon is offline   Reply With Quote
Old 8th May 2003, 13:47   #31
nixa
Senior Member
 
Join Date: Jul 2002
Posts: 149
Yeah you use x=x/z;y=y/z; or something similar
Asin(1) equals pi what is 3.14159 and is a constant.
since basic arguments for sin function are from 0 to 2*pi and i goes from 0 to 1 statement i*pi*4 makes 2 sine waves and t variable(have something like t=t+0.05 in the frame section) moves the waves
nixa is offline   Reply With Quote
Old 10th May 2003, 16:52   #32
Deamon
Major Dude
 
Deamon's Avatar
 
Join Date: Nov 2002
Location: Arnhem, the Netherlands
Posts: 927
ok thank you very much

.:HyperNation @ winamp:. .:DeviantArt:.
Thermal is now available for download at DeviantArt.
Deamon is offline   Reply With Quote
Old 11th May 2003, 09:28   #33
Deamon
Major Dude
 
Deamon's Avatar
 
Join Date: Nov 2002
Location: Arnhem, the Netherlands
Posts: 927
what is a rotation matrix?

.:HyperNation @ winamp:. .:DeviantArt:.
Thermal is now available for download at DeviantArt.
Deamon is offline   Reply With Quote
Old 11th May 2003, 15:31   #34
Jaheckelsafar
Major Dude
 
Join Date: Feb 2002
Location: home
Posts: 1,318
Here's a handy-dandy site http://mathworld.wolfram.com/RotationMatrix.html
To boils down to
code:

x=cos(th)*x1+sin(th)*y1;
y=-sin(th)*xi+cos(th)*y1;


still, check the sight out. You might learn something.

Stoke me a clipper. I'll be back for Christmas.

- Arnold Rimmer
Red Dwarf
Jaheckelsafar is offline   Reply With Quote
Old 12th May 2003, 09:43   #35
Deamon
Major Dude
 
Deamon's Avatar
 
Join Date: Nov 2002
Location: Arnhem, the Netherlands
Posts: 927
I checked the site, and it explained a only very few things to me. My english is way too bad for it :P. Could you please clear those formulas a bit for me?

x=cos(th)*x1+sin(th)*y1;
y=-sin(th)*xi+cos(th)*y1;

.:HyperNation @ winamp:. .:DeviantArt:.
Thermal is now available for download at DeviantArt.
Deamon is offline   Reply With Quote
Old 12th May 2003, 13:49   #36
Jaheckelsafar
Major Dude
 
Join Date: Feb 2002
Location: home
Posts: 1,318
x1 and y1 are your initial x and y values
th is the angle of rotation in radians (2*pi = one full rotation)
x and y are your rotated x and y values

I can't explain anymore than that because I only half get it myself.

Stoke me a clipper. I'll be back for Christmas.

- Arnold Rimmer
Red Dwarf
Jaheckelsafar is offline   Reply With Quote
Old 12th May 2003, 16:42   #37
Deamon
Major Dude
 
Deamon's Avatar
 
Join Date: Nov 2002
Location: Arnhem, the Netherlands
Posts: 927
ok thanks, now it makes complete sense to me . Now I'd like to know how to add the z axis. so there is a way to add a z value just like x1, and y1. Any suggestions?

PS.

thank you very much for all the patience and explanation for me, I really appreciate all the effort.

.:HyperNation @ winamp:. .:DeviantArt:.
Thermal is now available for download at DeviantArt.
Deamon is offline   Reply With Quote
Old 13th May 2003, 03:23   #38
Jaheckelsafar
Major Dude
 
Join Date: Feb 2002
Location: home
Posts: 1,318
You only rotate around 2 axes at a time. x-y, y-z, z-x.

Stoke me a clipper. I'll be back for Christmas.

- Arnold Rimmer
Red Dwarf
Jaheckelsafar is offline   Reply With Quote
Old 13th May 2003, 09:29   #39
shreyas_potnis
Major Dude
 
shreyas_potnis's Avatar
 
Join Date: Jan 2003
Location: Mumbai, India
Posts: 787
i searched the sites a lot for rotation matrix but i got the same things, so these sites only explain the concepts, you need a good teacher to master it or experiance
btw.

x degrees = x * pi / 180 radians

http://home.iitb.ac*****~shreyaspotnis
shreyas_potnis is offline   Reply With Quote
Old 13th May 2003, 20:43   #40
dirkdeftly
Forum King
 
dirkdeftly's Avatar
 
Join Date: Jun 2001
Location: Cydonia, Mars
Posts: 2,651
Send a message via AIM to dirkdeftly
yes, but DON'T bother converting between degrees and radians, as el-vis does in his engine.

and you rotate around 1 axis at a time, the two axes used in the rotation matrix are the ones that define the plane perpendicular to that axis. so this rotation:
x=x1*sin(theta)+y1*cos(theta); y=x1*cos(theta)-y1*sin(theta);
rotates around the z axis, but *inside* the x/y plane perpendicular to the z axis.

"guilt is the cause of more disauders
than history's most obscene marorders" --E. E. Cummings
dirkdeftly is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Visualizations > AVS

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump