Old 4th October 2002, 19:48   #1
dirkdeftly
Forum King
 
dirkdeftly's Avatar
 
Join Date: Jun 2001
Location: Cydonia, Mars
Posts: 2,651
Send a message via AIM to dirkdeftly
3D polar coords.

Do they exist/what are they? I ask because I'm trying to make a preset with a point that bounces around in a sphere (I've already conquered the circle )

"guilt is the cause of more disauders
than history's most obscene marorders" --E. E. Cummings
dirkdeftly is offline   Reply With Quote
Old 4th October 2002, 22:47   #2
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
There are two ways to do 3d polars that I know of (in 3-space it is even more obvious that polars are just convenient parametrics).

Spherical: you have d, theta, phi.

Cylindrical: you have d1, d2, theta

Cylindrical is easy to figure out, you basically add a height value to your 2d polars. This probably won't help you very much with your sphere problem.

The spherical co-ords are a bit more complex, you have the distance and theta but phi is the angle between the ray passing through the point and the origin and the z axis, rather than the projected angle between them onto the xz or yz plane. You've probably already seen this co-ordinate system being used to define sphere parameterisations. The conversion formulae are:

x=d*cos(theta)*sin(phi)
y=d*sin(theta)*sin(phi)
z=d*cos(phi)

and

d=sqrt(x^2+y^2+z^2)
theta=arctan(y/x)
phi=arctan(sqrt(x^2+y^2)/z)

You can probably figure this out for yourself if you drew a diagram, just to check that my maths is right here.

In this coordinate system it is also common to replace d with rho.

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 5th October 2002, 04:00   #3
Zevensoft
Major Dude
 
Zevensoft's Avatar
 
Join Date: Apr 2002
Location: Ballarat, Australia
Posts: 529
Damnit I wish AVS had array support, then I could make uber-cool water-spheres (NOT metaspheres)
Zevensoft is offline   Reply With Quote
Old 5th October 2002, 04:09   #4
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
If avs had array support I could make my high fps, constantly zooming, mandelbrot set.

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 24th December 2002, 02:48   #5
mikm
Major Dude
 
mikm's Avatar
 
Join Date: May 2001
Location: somewhere else
Posts: 1,255
I'm a bit confused on how to implement this...I've played around with it for a while, but still am confused

powered by C₂H₅OH
mikm is offline   Reply With Quote
Old 24th December 2002, 08:12   #6
dirkdeftly
Forum King
 
dirkdeftly's Avatar
 
Join Date: Jun 2001
Location: Cydonia, Mars
Posts: 2,651
Send a message via AIM to dirkdeftly
why do you keep bringing up these ancient topics?

"guilt is the cause of more disauders
than history's most obscene marorders" --E. E. Cummings
dirkdeftly is offline   Reply With Quote
Old 24th December 2002, 19:21   #7
mikm
Major Dude
 
mikm's Avatar
 
Join Date: May 2001
Location: somewhere else
Posts: 1,255
I am intrested in using polar coordinates, I looked back here earlier, was confused and could not figure out how to implement it. I hardly think a couple of months ago is ancient

powered by C₂H₅OH
mikm is offline   Reply With Quote
Old 25th December 2002, 21:45   #8
dirkdeftly
Forum King
 
dirkdeftly's Avatar
 
Join Date: Jun 2001
Location: Cydonia, Mars
Posts: 2,651
Send a message via AIM to dirkdeftly
Yes it is. There's a reason this forum defaults to only displaying posts from the last five days.

And if you don't already have a use for it, then why did you post in the first place?

"guilt is the cause of more disauders
than history's most obscene marorders" --E. E. Cummings
dirkdeftly is offline   Reply With Quote
Old 29th December 2002, 13:12   #9
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
Michalethecat: You need to set up a 3D projection and values for whichever out of d1, d2, theta and phi you are going to use.

Example spherical SSC:

code:

Per Frame: rx=rx+0.01;ry=ry-0.02;rz=rz+0.1*getspec(0.1,0.1,0);crz=cos(rz);srz=sin(rz);cry=cos(ry);sry=sin(ry);crx=cos(rx);srx=sin(rx);asp=h/w;

Per Point:

d=0.5;
r1=7*i;
r2=140*i;

x1=d*cos(r1)*sin(r2);
y1=d*cos(r1)*cos(r2);
z1=d*sin(r1);

x2=x1*crz-y1*srz;
y2=x1*srz+y1*crz;
z2=z1;

x3=x2*cry+z2*sry;
y3=y2;
z3=-x2*sry+z2*cry;

x1=x3;
y1=y3*crx-z3*srx;
z1=y3*srx+z3*crx;

z1=1/(2+z1*0.5);

x=asp*x1*z1;
y=y1*z1;



rx, ry and rz ar the rotations around the x, y and z axis respectively and d, r1 and r2 are d, theta and phi described above.

What you can see is two opposite 'spirals' around the surface of a sphere defined by radius=0.5 (d=0.5.

Hope that helps somehow.

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 30th December 2002, 03:04   #10
mikm
Major Dude
 
mikm's Avatar
 
Join Date: May 2001
Location: somewhere else
Posts: 1,255
Thanks Jheriko. that's a big help.

powered by C₂H₅OH
mikm 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