4th October 2002 20:48 UTC
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 :D )
Archive: 3D polar coords.
dirkdeftly
4th October 2002 20:48 UTC
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 :D )
jheriko
4th October 2002 23:47 UTC
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.
Zevensoft
5th October 2002 05:00 UTC
Damnit I wish AVS had array support, then I could make uber-cool water-spheres (NOT metaspheres)
jheriko
5th October 2002 05:09 UTC
If avs had array support I could make my high fps, constantly zooming, mandelbrot set.
mikm
24th December 2002 03:48 UTC
I'm a bit confused on how to implement this...I've played around with it for a while, but still am confused
dirkdeftly
24th December 2002 09:12 UTC
why do you keep bringing up these ancient topics?
mikm
24th December 2002 20:21 UTC
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
dirkdeftly
25th December 2002 22:45 UTC
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?
jheriko
29th December 2002 14:12 UTC
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:
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;
mikm
30th December 2002 04:04 UTC
Thanks Jheriko. that's a big help.:)
Fork me on GitHub