Archive: Efficient Cube?


5th November 2004 01:38 UTC

Efficient Cube?
http://www.lggaming.com/user/xerol/xerol-avs.zip
^(Preset "Cube Lake" in above .zip)^

The cube itself is handled by 24 megabuf entries used in init, then swapping between point and line mode to draw the 12 segments. I've had one problem; it seems to only work with n=26 or greater(when it should be 25) but other than that it works fine.

Now, the question here is, "Is this the best way to do this"? There's no actual way to draw the cube in one solid line, but 5 boxes could do the job(at a waste of 8 lines).

Also, I've got a question about the rotations. First off, when I attempted to put them in as a single statement, they didn't work properly, so I did the stepwise version there.

Finally, any general comments about that or the others in that file? There's a newer version of Spiradelic in the zip as well.


5th November 2004 12:11 UTC

"There's no actual way to draw the cube in one solid line"

bzzzzpt wrong! How many times do I have to tell you people, you can make ANYTHING with one scope.


5th November 2004 12:52 UTC

The cube itself is handled by 24 megabuf entries used in init, then swapping between point and line mode to draw the 12 segments. I've had one problem; it seems to only work with n=26 or greater(when it should be 25) but other than that it works fine.
no point to use megabuffer (array), its quite a slow, you can do wireframe cubes with faster methods and using multiple superscopes.

There's no actual way to draw the cube in one solid line
it's possible, PAK-9 has done it already.

Also, I've got a question about the rotations. First off, when I attempted to put them in as a single statement, they didn't work properly, so I did the stepwise version there.
I suggest you to /google or /mathworld or /wiki. Stuff that works in math works in avs aswell.
Imho you'r doing the rotation in correct way, you dont have to use rotation matrices.

Your math seems quite fine, try more to concentrate on aesthetical side of presets, ofcourse if you just want to toy around with 3D, no one forces you :).
If you want some preset examples (solid wireframe ;), bezier etc.) and relatevely simple math check my Deviantart account (link in signature).

5th November 2004 19:44 UTC

Toplogically there's no way to draw a cube with a single line without overlaps. (Shoulda said that first.) I had a diagram done out, It can't be done with any less than 16 lines or something like that. Which is only a waste of 4 lines, really, but it's still a waste.


5th November 2004 21:33 UTC

use 'skip' for overlaps, or connections... you cant do it with exactly 13 points (the mathematical minimum) but the additional lines required are an infinitessimal performance hit.