Archive: 3d sphere


7th February 2003 21:30 UTC

3d sphere
Hey :)
I have searched the forums and i came up with several presets containing code to make a sphere...None of them was too great so i was wondering if you can tell me the simplest way to make one :) I`ve seen movements that create a sphere from a simple scope and scopes recreating the effect but i didnt like it.You need pi in the ecuation right ?


7th February 2003 22:00 UTC

The easiest way to create a sphere is to create a spiral on the xz plane, but have the y variable change from -r to r. This will create the sphere that looks like a coil that starts small at the top, gets big in the middle, and gets small again at the bottom.


7th February 2003 23:47 UTC

If you make a spiral like that, you should have an equal spread across the surface, not have the y var increase linearly.


7th February 2003 23:48 UTC

parameterization for a sphere:
x=sin(theta)*sin(phi);
y=cos(theta)*sin(phi);
z=cos(phi);
where theta and phi are angles. this gives you a point on the sphere, gravitating towards two poles...anyone know of any way to make a randomly-generated point sphere that doesn't do this?


9th February 2003 00:11 UTC

Create a 3D box of points, then normalize each one to the radius required.


9th February 2003 21:31 UTC

Thanks for your ideas...Im working on a scope right now to make a 3d sphere that moves...I believe it will replace a dm with success :) Now another small question : is theta recognised by AVS ? i saw a preset with theta and it had no value in init or anywhere else...


9th February 2003 21:43 UTC

No its not recognized by avs. Are you sure it wasn't used in x=... or y=...? Variables don't have to be initialized - they default to zero.


9th February 2003 21:46 UTC

It was in x=... I`ll try to look it up in my preset library hehe.Except x,y,d,r and all that crap are there some other variables avs have incorporated ?


9th February 2003 21:47 UTC

Search the forums. This has been adressed. Probably somewhere in the FAQ. Also, look below the per pixel box. It tells you all of the variables there.


9th February 2003 21:53 UTC

I have that forum thread with variables saved :) I meant unknown variables as in easter eggs or hidden in the code...like pi(i hope avs would contain it...writing pi=acos(-1) everytime is boring).


9th February 2003 22:27 UTC

No, there are no easter egg variables in AVS. They didn't document a couple of functions, though. atan2(x,y) and another one(can't remember what it is). These have also been mentioned in the forums. Use the search feature.


10th February 2003 02:03 UTC

the other one is:
exp(var)::e^var
as in the inverse of:
log(var)::ln var


10th February 2003 02:06 UTC

Thanks Atero. I'd forgotten that one as I never use it(or log for that matter).


10th February 2003 06:05 UTC

Something that is stupidly missing though is a Base X log of Y function. They should implement a Log2(x,y) that should be is the same as: Log Y / Log X


10th February 2003 08:58 UTC

Zevensoft, there's no point in that really, because your CPU calculates it exactly the same way. An x86 cpu can only take base-2 logarithms.

Any other logarithm is calculated as log2(y) / log2(x).


11th February 2003 11:39 UTC

Thanks for your tips...Im working on a superscope trying to recreate a sphere :) I want to make a big big one change into dots and make it move.I`ve seen it several times and its amazing how it goes :) Btw...does AVS have any easter eggs at all ?


11th February 2003 12:34 UTC

No, just two functions that aren't documented - atan2(x,y) and exp(x).


14th February 2003 17:03 UTC

I dont know who made this, but it was on my comp... maybe it could help?


16th February 2003 20:47 UTC

Thanks for the file but i already have it :) Im trying to figure it out and i dont understand why the creator used such big numbers when i modified the preset and it work with smaller numbers too...


16th February 2003 21:39 UTC

He used bigger numbers to create a better random number generator.


16th February 2003 22:22 UTC

Now that i think about it.. I think it was made by UnConeD but im not 100% sure.. actually i'm not sure at all, but I get this feeling it was.

I'm not saying im physcic or anything..


17th February 2003 05:19 UTC

Yeah, that was UnConed.