5th October 2004 14:13 UTC
How to make a sentered cube
Can somebody tell me how to make a sentered cube? Something like this ->
http://www.nylands.org/~eneo/upload/uploads/cube.JPG
Thanks
Archive: How to make a sentered cube
eNeo
5th October 2004 14:13 UTC
How to make a sentered cube
Can somebody tell me how to make a sentered cube? Something like this ->
http://www.nylands.org/~eneo/upload/uploads/cube.JPG
Thanks
Montana
5th October 2004 16:08 UTC
link not working
Tuggummi
5th October 2004 16:17 UTC
It's working, but it's not a cube, it's just a square...
PAK-9
5th October 2004 21:39 UTC
I just ranted in that mysterious_w thread about noobs so I'm feeling generous...
init:
n=5;
size=0.5; //how big is the square (0-1)
frame:
point=0;
pixel:
point=point+1;
x=-equal(point,0)+equal(point,1)+equal(point,2)-equal(point,3);
y=equal(point,0)+equal(point,1)-equal(point,2)-equal(point,3);
x=x*size;
y=y*size;
there are slightly more efficient ways but this is more readable so please dont post petty optimisations.
eNeo
6th October 2004 02:03 UTC
Yea a square, I'm sorry. Not a cube.
Thanks
PAK-9
6th October 2004 16:49 UTC
re-looking at it that code is wrong, sorry, you need to put the point=point+1; at the end of the pixel box
Montana
6th October 2004 18:22 UTC
also working is
init:
n=5;
frame:
asp=h/w;
point:
r=i*$pi*2+$pi/4;d=0.5;
x=sin(r)*d*asp;y=cos(r)*d;
d=0.5 //this is the size of the cube
asp=h/w; // aspectratio correction
PAK-9
6th October 2004 21:11 UTC
hmm, I guess, except thats pretty ugly and inefficient.
S-uper_T-oast
6th October 2004 22:33 UTC
Point per point is the way to go. PAK got it.
There is another way to write it out, but thats not that big of a deal because it wouldn't make any noticible differenece in the preset.
Tuggummi
7th October 2004 09:46 UTC
There is a way for making a square if you want to use more than 5 numpoints. (vibration anyone?)
Init
n=500
(or whatever numpoint value you wish for)
Per Pixel
r=i*$pi*2 ; size=0.5 ;
xa=asin(sin(r))*size ;
ya=asin(cos(r))*size ;
x=xa+ya ;
y=xa-ya ;
Now to make it vibrate on music, you can for example do:
size=0.5+v*0.2
^..^
7th October 2004 10:24 UTC
--- oops.. montana has mentioned it already, sorry---
That's cool! Thanks for the tip!
Correct me if i'm wrong: if you want to make it a real square and independent from screensize you have to change:
FRAME:
fixsize=h/w
PIXEL:
x=(xa+ya)*fixsize
should work with circles and else too.
PAK-9
7th October 2004 17:12 UTC
Originally posted by TuggummiMmmmm, 1000 asines and 1000 sines for a square
There is a way for making a square if you want to use more than 5 numpoints. (vibration anyone?)
Init
n=500
(or whatever numpoint value you wish for)
Per Pixel
r=i*$pi*2 ; size=0.5 ;
xa=asin(sin(r))*size ;
ya=asin(cos(r))*size ;
x=xa+ya ;
y=xa-ya ;
Now to make it vibrate on music, you can for example do:
size=0.5+v*0.2
^..^
7th October 2004 17:51 UTC
But if i use montana's or your code, my scope is just build out of 2 horizontal and 2 vertical lines that can react as a whole to the music. In Tug's example the scope consists out of 500 points that can vibrate independent, isn't it?
Tuggummi
10th October 2004 02:04 UTC
Yup, it does "cost" a lot (atleast according to these über benchmarkers...), but it can be sometimes more useful than the fast simple way.
S-uper_T-oast
10th October 2004 08:33 UTC
Only if you want shifting colors or sounds vibrating sounds or something fancier. There is still a fasterer way to do it point-per-point wise by using custom counters to move the points along the sides, then switching from side to side after a certain amount of points
Tuggummi
10th October 2004 14:47 UTC
Or if you want to use Texer II, don't forget about that.
[edit]
And btw. never ever say "only if...", because as soon as you say that someone already makes up another use for it you never even thought of.
[/edit]
PAK-9
10th October 2004 19:09 UTC
Originally posted by S-uper_T-oastThats a better way to do it than Tugs way, because your just doing a series of additions and a few 'ifs' rather than nasty trig. I'd post code but I cant be bothered.
Only if you want shifting colors or sounds vibrating sounds or something fancier. There is still a fasterer way to do it point-per-point wise by using custom counters to move the points along the sides, then switching from side to side after a certain amount of points
Tuggummi
10th October 2004 23:31 UTC
Never understimate the power of the dark side my son...
The sin()lords will get their revenge! buahahah!!!
PAK-9
11th October 2004 02:03 UTC
How many hours did you spend thinking that one up
Tuggummi
11th October 2004 10:53 UTC
Actually it just came to me in a vision, like all my PWNing presets that use lots and lots of sin's and cos's! :blah:
Jaak
15th October 2004 15:07 UTC
Originally posted by PAK-9didn't you know?
How many hours did you spend thinking that one up
PAK-9
16th October 2004 01:21 UTC
Originally posted by JaakBest preset? I thought thats how tugg came up with all his code. It's all in the PAK film "PAK-9 AVS 4 SE in outer space!"...
didn't you know?
Tugg has slaved thousands of monkeys and made them type random code, eventually they *will* code best preset.
Warrior of the Light
16th October 2004 15:33 UTC
Originally posted by PAK-9*cough* :)
How many hours did you spend thinking that one up
Tuggummi
16th October 2004 17:47 UTC
hahahahahahah
Great Story PAK-9 :D
Maybe someone ought to produce a AVS-Movie from that script ;)
PAK-9
18th October 2004 09:23 UTC
Originally posted by TuggummiI told you its called a PAK-Film tm (R)not an "AVS-Movie"
hahahahahahah
Great Story PAK-9 :D
Maybe someone ought to produce a AVS-Movie from that script ;)
Tuggummi
18th October 2004 15:30 UTC
Oh go fudge yourself.
UnConeD
20th October 2004 05:55 UTC
But but.... how does the Man with Newspaper fit into all this?
PAK-9
21st October 2004 17:17 UTC
Well when Ambassador Middleton is talking to Captain 'Orange' Johnson about how much emergency jam to load onto the ship, there is a guy sitting just in view of the camera behind the crates of jam on the left. Man with newspaper is just behind him... reading a newspaper. And if you read carefully (you need to put your face really close to the screen) the headline on the front says "Wittens Arrested in Zebra Raid"... Just one of over three hundred zebra references crammed into the film.
Fork me on GitHub