Winamp & Shoutcast Forums > AVS 3D polar coords.

 4th October 2002, 19:48 #1 dirkdeftly Forum King     Join Date: Jun 2001 Location: Cydonia, Mars Posts: 2,651 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
 4th October 2002, 22:47 #2 jheriko Forum King     Join Date: Aug 2002 Location: a twist in the fabric of space Posts: 2,150 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'
 5th October 2002, 04:00 #3 Zevensoft Major Dude     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)
 5th October 2002, 04:09 #4 jheriko Forum King     Join Date: Aug 2002 Location: a twist in the fabric of space Posts: 2,150 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'
 24th December 2002, 02:48 #5 mikm Major Dude     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
 24th December 2002, 08:12 #6 dirkdeftly Forum King     Join Date: Jun 2001 Location: Cydonia, Mars Posts: 2,651 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
 24th December 2002, 19:21 #7 mikm Major Dude     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
 25th December 2002, 21:45 #8 dirkdeftly Forum King     Join Date: Jun 2001 Location: Cydonia, Mars Posts: 2,651 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
 29th December 2002, 13:12 #9 jheriko Forum King     Join Date: Aug 2002 Location: a twist in the fabric of space Posts: 2,150 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'
 30th December 2002, 03:04 #10 mikm Major Dude     Join Date: May 2001 Location: somewhere else Posts: 1,255 Thanks Jheriko. that's a big help. powered by C₂H₅OH
 Winamp & Shoutcast Forums > AVS 3D polar coords.