|
|
#1 |
|
Junior Member
Join Date: Nov 2002
Location: somewhere within
Posts: 41
|
idiot movement question
Just a quickie for anybody that likes answering stupid questions... how do I make something rotate in 2-D? I have a nifty effect that I'm using, and I want it to rotate clockwise, but for some reason (most likely my mathematical ineptitude) I can't figure out how to do it.
Could somebody point me in the right direction...? Thanks.
|
|
|
|
|
|
#2 |
|
Senior Member
|
In a movement, type:
r=r+0.1; Increase the 0.1 for a faster rotation. Or for more responsiveness, type this in a DM: init: a=1; frame: fr=fr+bfr*a; beat: bfr=rand(10)/100; a=-a; pixel: r=r+fr; In pixel, add d=d/1.05 for a bit of zoom. |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Jul 2002
Posts: 149
|
If you need a list of effects rotating use a dynamic movement:
frame: t=t+0.05; pixel: r=r+t; if you need a super scope rotating add t=t+0.05 to frame and this to end of poind section: svx=x;x=sin(t)*x+cos(t)*y;y=cos(t)*svx-sin(t)*y; |
|
|
|
|
|
#4 |
|
Major Dude
Join Date: Feb 2002
Location: home
Posts: 1,318
|
You can also rotate in the cartesian system.
x1=cos(r)*x+sin(r)*y; y1=-sin(r)*x+cos(r)*y; x=x1; y=y1; It's faster that converting to polar then back (I think). Stoke me a clipper. I'll be back for Christmas. - Arnold Rimmer Red Dwarf |
|
|
|
|
|
#5 |
|
Forum King
|
Quicker, but less acurate. The rectangular rotation is ellipsoidal, instead of circular.
"guilt is the cause of more disauders than history's most obscene marorders" --E. E. Cummings |
|
|
|
|
|
#6 |
|
Major Dude
Join Date: Feb 2002
Location: home
Posts: 1,318
|
You can scale the rotation the normal way.
x1=(cos(r)*y+cos(r)*y)*h/w; Stoke me a clipper. I'll be back for Christmas. - Arnold Rimmer Red Dwarf |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Nov 2002
Location: somewhere within
Posts: 41
|
Argh... this is not working out the way I wanted it to... this thing does not rotate well, apparently. Thanks for the help though, I'll keep it in mind next time I want to rotate something.
|
|
|
|
|
|
#8 |
|
Major Dude
Join Date: Feb 2002
Location: home
Posts: 1,318
|
Post the preset. Let us see the code, maybe we can spot errors.
Stoke me a clipper. I'll be back for Christmas. - Arnold Rimmer Red Dwarf |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|