Skip to content
Forum Archive

Simple Rotation whitout beatdetect

16 posts

moon44#

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
mikm#
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
moon44#
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...
mikm#
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.
moon44#
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
mikm#
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).
Warrior of the Light#
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.
moon44#
@mikm: yeah, thats it!! great thx.
@warrior: the site is now bookmarked 🙂

thank you all
moon
hboy#
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!
WalkerP#
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?
^..^#
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.
S-uper_T-oast#
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