Archive: how can i rotate a pic in x- or y- axis?


10th July 2002 23:43 UTC

how can i rotate a pic in x- or y- axis?
i want to rotate a pic(render/picture) in the x- or y- axis, how can i do that?

thanx for help

GreatWho


21st July 2002 17:39 UTC

Might be a bit late, but this might help. I use this in a superscope, but you should be able to convert it to a DM. Just initialize z1 at the beginning of each point. x1 and y1 are the coordinates of the point before any rotation. keep track of how far you're rotating in xy and yz.

-------------------------------

x2=cos(xy)*x1+sin(xy)*y1;
y2=-sin(xy)*x1+cos(xy)*y1;

y3=cos(yz)*y2+sin(yz)*z1;
z2=-sin(yz)*y2+cos(yz)*z1;

z=z2+1;
x=x2/z;
y=y3/z;


22nd July 2002 08:19 UTC

Try this DM:

Frame: t=t+.04

Pixel:x=x/((cos(t)));
y=-y/(.5*x*sin(t)-1)

Grid size must be:80x60 or if you want to rottate objects that are half of screen size you can reduce it to 80x16. Rectangulara and billinear must be ON.


Tonic


22nd July 2002 17:57 UTC

Well, Tonic, that's a good idea, but unfortunately it creates huge distortions in the picture - even when the rotation is very slight. The best bet for this kind of rotation is a 3D projection. Just use the regular rotation formula:
a2=a1*sin(theta)+b1*cos(theta);
b2=a1*cos(theta)-b1*sin(theta);
(where a1 and b1 are the original coordinates along the a and b axes, and theta is the rotation angle in radians) upon the planes perpendicular to the axes rotated. This means that a rotation around the Z axis would be upon the X/Y plane. Then, at the end...umm...actually I don't want to mislead you in this matter, so I'll turn it over to UnConeD, since he 'taught' me how to do this (even though I don't do what he said to do - i just try to figure out how to squish the stuff and it goes blah...yeah).



OR...If you're rotating around the Z axis, it's pretty simple. Just use the rotation for the Z axis, as there doesn't need to be any translation:
t=t+0.01
----------
x1=x;
x=x*sin(t)+y*cos(t);
y=y*cos(t)-x1*sin(t);
OR...You could just rotate it in polar coordinates and translate between them. The rotation is pretty simple:
t=t+0.01
----------
r=r+t;
And these are the translations:
r=atan2(x,-y);
d=sqrt(x*x+y*y)/sqrt(2);
x=sin(r)*d*sqrt(2);
y=-cos(r)*d*sqrt(2);

Glad to...uh...help ;)


22nd July 2002 22:18 UTC

Tonic
By the way Tonic.. back in the AVS business? :D


23rd July 2002 08:27 UTC

UnConeD. I never stop to be with AVS :). I continue to check almost every day forums and AVS sites. But stop to create AVS. For now I do not plane to create AVS until Justin do not create NEW version of AVS with new effects and improved features for VJing and usability of AVS.

Altero: Yes I know that it may create a lot of distortions but not in all cases. Distortions can be avoided if edges of object that you want to rotate are not so close to edges of screen. Also you can tweak grid size to create better result.
I try example that you write but cannot produce such effect that "greatWho" wants, and Z rotation look so bad :( . I'm not keen with 3D projection, reytracing and etc. that UnConeD use :) so I cannot fix it to be real X,Y or Z rotation. If you or someone could. Pls write such examples.


23rd July 2002 11:59 UTC

Originally posted by Tonic
For now I do not plane to create AVS until Justin do not create NEW version of AVS with new effects and improved features for VJing and usability of AVS.
That is a shame Tonic, you do some nice stuff, as that means it will be 2004 until we see a new pack from you.;)

Did you know Justin has never even posted in the AVS forum. I think he has forgotten about it.:)

23rd July 2002 12:34 UTC

Originally posted by Rovastar


That is a shame Tonic, you do some nice stuff,
That is problem. They are just nice :) I think my mission is completed, as I'm one of pioneers of AVS and most of all I work and made most of my AVS to populirize this plugin.

In this days there are many AVS artist that do "some nice stuff".

And after near half milion DL of my AVS Albums from WINAMP.COM I've got only tons of viruses in my mail boxes every day :)

Tonic

23rd July 2002 17:58 UTC

thanx for your solutions
Tonic: your solutoin is very easy, it looks fine,because the distortions at the edges i made two SS to cover them ;-) so it's only the picture with rotation;

Atero: your solution distorted the whole pic but i used this for any SS and they look very nice

so i show you 2 results... one is with a (bad :( )pic of me its only to show who made the presets ;)
the other one is a rotating sexy Girl (maybe you would like more than the one with my pic ;) )
the zip is too large to attach, so take it from here:
http://217.162.154.91/patrik1.zip

thanx alot

ps: are the most avs'ers from Europe?? only Atero, who is from Mars...


24th July 2002 12:46 UTC

as I'm one of pioneers of AVS
Aren't we modest. :) Keep in mind I say this without having seen your work.

greatWho: I'm from Australia myself.

24th July 2002 14:02 UTC

uNDefineD: If you haven't seen tonic's work, download it now :). http://tonic.deviantart.com/ should get you started. It's been a while since he released presets, but he's got some gems in there.

I think what he meant with "I'm one of the pioneers" is that he's been AVSing for a long time, from near the very beginning. Kind of like Lone.


24th July 2002 15:39 UTC

Originally posted by uNDefineD


Aren't we modest. :) Keep in mind I say this without having seen your work.

I'm as modest as I can. But if you want from me to be less modest I can. I may write you little history of my AVS life. I create AVS since v0.20a link for AVS v0.20a and this was before near 3 years if I remember well I made my first preset in November or December 1999. I release my first AVS pack in www.deskmod.com in January 2000 of course AVS in this days are not as this in this days. In this time there was still no AVS section in WINAMP.COM. So when in August 2000 I made my first AVS Album with 130 presets I submit it in WINDOW and FULLSCREEN section. Then I start to wait to see how WINAMP staff will review my firs Album and for my great surprise they opend new section called "AVS presets" and thay open it with my Album. After that I release 4 more Albums under "Tonic" nick and one under "Gazirana Voda" nick. If you want to see them go to this links.


Tonic 1st 08.2000
Gazirana Voda 04.2001
Tonic 2nd 05.2001
Tonic 3rd 07.2001
Tonic 4th 01.2002
Tonic 5th 01.2002

Average DL for ALL of them are 100'000 (less 32'000 most 171'000).
I'm still modest :)

PS: UnconeD is right I'm in AVS from very close to Lone beginning

24th July 2002 15:50 UTC

Re: thanx for your solutions

Originally posted by greatWho
Tonic: your solutoin is very easy, it looks fine,because the distortions at the edges i made two SS to cover them ;-) so it's only the picture with rotation;

I think you do not fix correctly problem with distortions. And speed is very slow. I attached two examples you may use them to produce better result. In this AVS I fix problems with Distortions that Altero mentions with using Movement for reducing size of rotating object with .9 of screen size. And jumping rotation forward in the moment before distortions so there is no position where distortions can apear:)

24th July 2002 15:56 UTC

I forgot attachment or it do not work for me. So once again I try to attach one ZIP file with two presets :)


24th July 2002 18:34 UTC

Originally posted by Tonic


Average DL for ALL of them are 100'000 (less 32'000 most 171'000).
I'm still modest :)
Easy with the showing off stuff.:)

I mean WildTangent have had many MILLIONS plug-in downloads doesn't mean they are any good.:)

24th July 2002 18:54 UTC

As I said I'm modest ... :) Yes DL do not mean nothing. But sometimes they helps. In all case in this days people do not DL AVS albums like they do thàt before. Where is problem ...


24th July 2002 22:29 UTC

Wildtangent
Hehe it just shows how easy it is to get 90% of all the male population to download programs full of spyware as long as they get to see wobbling boobs.


24th July 2002 23:10 UTC

Tip for your next pack mate:

Ms Happy instead of Mister Happy. :);)


29th July 2002 01:28 UTC

Tonic is a pioneer!!!!
as an avs artist myself, i admire works from tonic. The download rate does mean much... Wildtangent has to sponsor ads for downloads, and there was once this one guy (indyrod ... lol) who got a crap load of downloads just because he had friends in high places.

if you look at tonic's work and the other work that came out at the same time, you'll see a vast difference between the two. Tonic has a very conceptual (did i spell that right?) look, while others look like crap.

Tonic has create AVSociety, which brought together some of the best avs artists ever. Tonic creates trends as he releases packs (B&W, 4d life in sofia).

One can only hope to achieve the amount and quality that tonic has brought here.

NOW ON THE TOPIC OF ROTATION: to make a rotation, just use r & d, but in regular movement with NO clear each frame, use a=x;b=y;x=x+b*0.05;y=y-a*0.05. that is the closest to a rotation thing i can think of.


29th July 2002 01:34 UTC

oops...
i thought you meant r=r+0.05 rotation... lol


30th July 2002 07:20 UTC

Horsefly: That rotation works for a z-axis rotation, and greatWho is looking for an x- or y-axis rotation (into the z-dimension). For zero distortion, you'd probably want to go with the 2-plane projection (I don't know why it didn't work for you, there must have been a typo).
I've attached the DM I'm talking about.


30th July 2002 19:06 UTC

yeah... i know... i goofed. I downloaded tonic's example, and that was when i figured that i screwed up... like unconed's April Fools forum (AVS 2.6) That C*NT That stupid CU*T... geez the idiotic *UNT!!!!