Archive: More AVS questions...


12th June 2002 02:40 UTC

More AVS questions...
Some more questions =รพ

1. Is there a way to fully randomize all the dots' position at the 1st frame, and keep that position? (w/o random generator, if possible)

2. Is there a way to make a filled triangle/square/pentagon/hexagon/octagon?

3. Is it possible to make a capsule-shaped 2D SSC w/o point-by-point assigning? (The only way I know of is to extend the SSC at the middle using point assignment)

4. 3D SSC prob : How do you make a sphere? ( :p )

5. Is there any 3D DM base code? (What I mean is, 3D SSC base code for DM)

I think that's all...

Oh, and BTW, others who have non-n00b AVS questions, feel free to use this topic to ask your questions =)


12th June 2002 05:02 UTC

1. No, use a random gen.

2. Uh? You do know how to do a solid superscope right? Just draw lots of lines to fill the area as needed. For polygons, you can either split it up as a quadstrip (strip of 4-sides polygons) or start at the outside and spiral towards the center.
I started doing a dodecahedron preset a while ago (which freaked because of too many variables) and I used the following scheme:

http://acko.net/dump/sscpenta.png

3. For a line superscope, just draw a circle and offset each half on an axis. AVS will draw the connecting lines. For a dot superscope you'll need to make a combined superscope that draws 2 half-circles and 2 lines. Use different code depending on the range of i.

4. Look up spherical coordinates and evaluate them for all allowed values (phi: [-pi/2,pi/2], theta: [-pi,pi]). Or alternatively use a circle in the xy plane, progress through the z axis linearly (e.g. z=i) and use sqrt(1-sqr(z)) as radius for the circle in xy.

5. 3D DM's are a complicated topic. I usually use raytracing, but you can also use the superscope principle on DM's. In any case, even if you had a base 3DDM, you would probably not get far because you need to know what you're doing.


3rd August 2002 23:24 UTC

Sorry for bumping, but I decide to keep my questions to 1 topic... keeping the forums tidy and neat-like :p

Anyways, I just got a new question :

Is it possible to group points in the SSC, such as 1000-point scope grouped into 10 sets, numbered 1-10... or each group valued ascending-ly in some sort...

Err, let me (kinda) simplify :

Is there a way to make a value increase by "a" every "b" points in a SSC?

I doubt I have any other questions... Thanks for anyone who answers this one =)


4th August 2002 18:28 UTC

You hafta use the modulus (%) to do that. It's a little slow, but it works. What the modulus does is return the remainder of division between a and b. So, for example, 12%10 returns 2. 3%5 returns 3.
Here's a sample:

Init: n = 10;
Frame: a = 0; b = 0;
Point: a = a + 1; b = b + equal(a % 10, 0 )

What that does is increase b every 10th a, and then resets them every frame.


4th August 2002 21:41 UTC

Actually, I don't think modulus is that much slower than any other operator.
Another example is:
a=(a+1)%10; b=if(a,b,b+1);
a goes from 0 to 9, then wraps back to zero every tenth frame. b increases only when a isn't unequal to zero (or, equal to zero, when you look around avs's psuedologic).


5th August 2002 10:49 UTC

It depends on what AVS calculates as modulus. I think it just uses the combined integer divide/modulus instruction. Note that this instruction is still faster than a floating point divide w/ modulus.