Archive: Simple Rotation whitout beatdetect


8th December 2004 00:02 UTC

Simple Rotation whitout beatdetect
hi all,

i search the syntax for a simple rotation per frame.
i think the trans dynamic movement is the right way. but i dont know the syntax. :(

thx moon


8th December 2004 00:52 UTC

You can just use a plain movement if it doesn't have to be dynamic. It will look prettier. Just do R = R + t (where t is the amount to rotate by in radians. There are 2pi radians in a circle, thus to rotate it 180degrees, rotate it pi radians. pi is a built in constant, represented as $PI


8th December 2004 01:11 UTC

thx for answer. is R the Constants of rotation ?

omg.... im a newbie. i come from Flash (actionscript) and i dont know the new syntax...


8th December 2004 01:54 UTC

Not exactly. R is the r-coordinate of the current pixel. Bascically, there are two major forms of graphing: cartesian (x,y) and polar(d, theta). In cartesian graphing, a point at (3,5) is 3 units to the right and 5 units up from the origin (0,0).

In polar graphing, (3, 5) means that the point's distance is 3 units from the origin. It is then rotated 5 radians counterclockwise (from "3 o'clock").

Thus, when you say r = r+.5; (d=d is assumed), every point is rotated by .5 radians. If you said d = 2d, then every point is twice the distance from the origin as normal.


8th December 2004 10:05 UTC

mikm, great explanation. ok, R cannot been a Constants, my fault. my syntax in trans movement:
d=d;
x=5;

thats simple and works fine in trans movement. but just only rotation at the moment. now i need the rotation everytime...
any ideas/help ?

thx moon


8th December 2004 12:34 UTC

Oh, so you want the rotation-constant to be changing constantly?

Then do a dynamic movement;

init t=0;
frame t=t+.1 <adjust the .1 to make it go faster;
beat: <blank>;
frame: r=r+t;

btw, you can't mix polar and cartesian. You have to use one. To convert:

Polar --> Cartesian
x=cos(r)*d;y=sin(r)*d;

Cartesian --> Polar
d=sqrt(x*x-y*y);
r=atan2(y,x);

You generally also don't want to do x=5 unless you know what it does. x=x+5 is probably what you were looking for.

x=x+5 shifts it
x=5 makes it so that for every point (x, y), it always uses the color value from (5,y).


8th December 2004 12:36 UTC

If you're interested in the techniques used in AVS, make sure you check the tutorials mentioned in the FAQ

//edit x=5 or even x=x+5? the window ranges from -1 to 1. that would shift it 2.5 entire windows away from what you see (if unwrapped). No matter what, use something smaller than 1, surely not 5.


8th December 2004 21:30 UTC

@mikm: yeah, thats it!! great thx.
@warrior: the site is now bookmarked :)

thank you all
moon


9th December 2004 08:31 UTC

Originally posted by mikm

Cartesian --> Polar
d=sqrt(x*x-y*y);
r=atan2(y,x);
this is incorrect, because the d (distance from the origin) equals to sqrt(x*x+y*y). maybe it is a small vertical line that differs, but a lot happens wrong if you do it without it :) just know pythagoras's rule!

9th December 2004 22:37 UTC

I was just gonna say that hboy.
:p


23rd December 2004 04:47 UTC

Seeing as this thread now seems to be about contverting polar to recangular ( Thats what I call it ), How would you make a 3D D for a SCC?


23rd December 2004 08:23 UTC

d=sqrt(sqr(x1)+sqr(y1)+sqr(z1)) :p pure vector math!


23rd December 2004 17:08 UTC

but in 3 dimensional polar coordinates you need to specify two angles. So the coordinates of a point would be (d/r1/r2). In maths mostly "phi" and "rho" are used for r1,r2.


24th December 2004 15:38 UTC

Polar -> Cartessian in 3D
x = r sin(a1) cos(a2)
y = r sin(a1) sin(a2)
z = r cos(a1)


Cartessian -> Polar in 3D
r = sqrt(x*x + y*y + z*z)
a2= atan(y/x)
a1= asin(sqrt(x*x + y*y) / r) = acos(z / r)

Where
r = Distance
a1=Angle 1
a2=Angle 2

x = x-axis
y = y-axis
z = z-axiz


24th December 2004 15:50 UTC

couldn't be told better in a math-book.


25th December 2004 01:18 UTC

Thankyou!!!!!