Old 7th December 2004, 00:30   #1
MaTTFURY
Major Dude
 
MaTTFURY's Avatar
 
Join Date: Jun 2004
Location: Australia,
Posts: 1,356
cube-E question

my Code for a cube is like this (and im not interested in the "quicker" ways... of doing anything ... just want to know... how can i make the cube... no rotation etc... (do i need the rotation?) well here it is:
code:

init: n=5;
frame:drawmode=1;
linesize=2;
rot=1;
point:point=(point+1)%4;
x1=-equal(point,0)+equal(point,1)+equal(point,2)-equal(point,3);
y1=equal(point,0)+equal(point,1)-equal(point,2)-equal(point,3);

x1=x1*0.2;
y1=y1*0.2;

x=x1*cos(rot)-y1*sin(rot);
y=x1*sin(rot)+y1*cos(rot);
x = x1+0.2; y = y1+0.2; z = -0.2; //plane 1
x2 = x2-0.2; y2=y2-0.2; z= 0.2 //plane2
//plane 3

now why cant i make a cube? NOTE:i have another "matrix" thingo you make in the pak-9's tutorial i was going to put a cube above in this...

i am not normal, no really.
MaTTFURY is offline   Reply With Quote
Old 7th December 2004, 06:19   #2
hboy
Senior Member
 
hboy's Avatar
 
Join Date: Dec 2003
Location: Hungary
Posts: 217
Send a message via AIM to hboy

first, i tell you some definitions. a cube is a 3 dimensional object that consists of much more points. Do you know what I am talking about, man? first, define n for this method. thats the most important. then you say you are doing no rotation.

code:

x=x1*cos(rot)-y1*sin(rot);
y=x1*sin(rot)+y1*cos(rot);



this is rotation, just because you have "rot" variable assigned to 1, you will never see this guy rotating. but thats okay since you didn't need that did you?

Moving on with the next lines of crap. cause that is it. if you want to make a cube, simply assign points like you did with the square. you gonna need n=(amount of lines in a cube)+1, because the starting point and ending point of the drawing is the same. do a point-per point assignment to x1,y1, and also z1.

and in the end, to merge the variables back into 2D:

code:

z2=1/(1+z1*0.5);
x=x1*z2;
y=y1*z2;



this code has no optimizations, no aspect ratios corrected, as your wish was. learn from it.
hboy is offline   Reply With Quote
Old 7th December 2004, 07:57   #3
Jaak
Major Dude
 
Jaak's Avatar
 
Join Date: Jan 2003
Location: Estonia.
Posts: 851
Quote:
Originally posted by hboy

Moving on with the next lines of crap. cause that is it. if you want to make a cube, simply assign points like you did with the square. you gonna need n=(amount of lines in a cube)+1, because the starting point and ending point of the drawing is the same. do a point-per point assignment to x1,y1, and also z1.
no hboy, you need 16 points iirc if you want to draw it with one line. Because you have to draw some points over to have continious line.

Anyways, as i have already sayd first try to make a cube out of 6 squares (6 superscopes), simply sync the movement and rotation of scopes, and you have a wireframe cube. thats the easiest and most logical way imo (im not saying its efficient or fast)

Phi = (1+sqrt(5))/2
Jaak is offline   Reply With Quote
Old 7th December 2004, 11:11   #4
hboy
Senior Member
 
hboy's Avatar
 
Join Date: Dec 2003
Location: Hungary
Posts: 217
Send a message via AIM to hboy
oops totally agreed Jaak, i forgot that and yeah it is also easier to sync 6 squares too
hboy is offline   Reply With Quote
Old 8th December 2004, 01:30   #5
TomyLobo
Major Dude
 
TomyLobo's Avatar
 
Join Date: Feb 2004
Location: Germany
Posts: 580
why 6 squares? 4 are enough
you can leave out 2 opposing sides without anyone noticing
also, the other ones need not be full squares, 3 borders would be enough

If you can't say something nice, say something surrealistic.
TomyLobo is offline   Reply With Quote
Old 8th December 2004, 01:45   #6
TomyLobo
Major Dude
 
TomyLobo's Avatar
 
Join Date: Feb 2004
Location: Germany
Posts: 580
here's the cube you'd have to draw (attachment)
each of these incomplete squares has another color
Attached Images
File Type: gif cube.gif (486 Bytes, 174 views)

If you can't say something nice, say something surrealistic.
TomyLobo is offline   Reply With Quote
Old 8th December 2004, 01:45   #7
Xerol
Junior Member
 
Join Date: May 2004
Location: Timonium, MD
Posts: 27
Send a message via ICQ to Xerol Send a message via AIM to Xerol Send a message via Yahoo to Xerol
Actually, all you really need are two parallel squares and 4 connecting lines.
Xerol is offline   Reply With Quote
Old 8th December 2004, 01:46   #8
TomyLobo
Major Dude
 
TomyLobo's Avatar
 
Join Date: Feb 2004
Location: Germany
Posts: 580
yes, but if you do it with the incomplete squares, you can maybe put it in one scope

If you can't say something nice, say something surrealistic.
TomyLobo is offline   Reply With Quote
Old 8th December 2004, 04:43   #9
Jaak
Major Dude
 
Jaak's Avatar
 
Join Date: Jan 2003
Location: Estonia.
Posts: 851
Quote:
Originally posted by TomyLobo
why 6 squares? 4 are enough
you can leave out 2 opposing sides without anyone noticing
also, the other ones need not be full squares, 3 borders would be enough
ofcourse you can, but like i sayd, i wanted to keep as simple and logical as possible.

Phi = (1+sqrt(5))/2
Jaak is offline   Reply With Quote
Old 8th December 2004, 21:29   #10
MaTTFURY
Major Dude
 
MaTTFURY's Avatar
 
Join Date: Jun 2004
Location: Australia,
Posts: 1,356
could you explain it better please? i am stupid!

i am not normal, no really.
MaTTFURY is offline   Reply With Quote
Old 9th December 2004, 07:28   #11
hboy
Senior Member
 
hboy's Avatar
 
Join Date: Dec 2003
Location: Hungary
Posts: 217
Send a message via AIM to hboy
you know that a cube consists of 6 sides, each can be considered as squares. soo...you need 6 squares! one for every side of the cube. place them as you would place the sides of the cube, and then you get your cube, I promise
hboy is offline   Reply With Quote
Old 9th December 2004, 16:35   #12
PAK-9
Major Dude
 
PAK-9's Avatar
 
Join Date: Oct 2002
Location: The United Kingdom of Great Britain and Northern Ireland
Posts: 1,374
There are numerous ways of doing it with one ssc, just think about it logically and do it the way that seems most natural. If you cant think of a way of doing it because its too complicated... maybe you shouldnt be doing it.

http://PAK-9.deviantart.com

...innit
PAK-9 is offline   Reply With Quote
Old 9th December 2004, 19:02   #13
hboy
Senior Member
 
hboy's Avatar
 
Join Date: Dec 2003
Location: Hungary
Posts: 217
Send a message via AIM to hboy
Quote:
Originally posted by PAK-9
There are numerous ways of doing it with one ssc, just think about it logically and do it the way that seems most natural. If you cant think of a way of doing it because its too complicated... maybe you shouldnt be doing it.
i totally agree with this. a cube is really a basic shape, either with point-to-point coding in one scope or with 6 scopes synchronized. if you can't do this, stay with the less-code side of AVS. you know, many people started that way, no 3D and superscopes, still, they were and are amazing artists. speaking about for example horse-fly, yathosho, tuggummi didn't know 3D also in the first few packs.
hboy is offline   Reply With Quote
Old 10th December 2004, 06:55   #14
MaTTFURY
Major Dude
 
MaTTFURY's Avatar
 
Join Date: Jun 2004
Location: Australia,
Posts: 1,356
code:
point=(point+1)%4;
x1=-equal(point,0)+equal(point,1)+equal(point,2)-equal(point,3);
y1=equal(point,0)+equal(point,1)-equal(point,2)-equal(point,3);

x1=x1*0.2;
y1=y1*0.2;
x = x1+0.2; y = y1+0.2; z = -0.2; //plane 1
x2 = x2-0.2; y2=y2-0.2; z2= 0.2 //plane2
x3 = x3+0.2; y3=y3+0.2; z3= -0.2 //plane 3
x4 = x4-0.2; y4 =y4-0.2; z4=0.2 //plane 4
x5 = x5+0.2; y5 = y5+0.2; z5 =-0.2 //plane 5
x6 = x6-0.2; y6 = y6-0.2; z6=0.2 //plane 6


now what should i add in? nothing appears in the visual part of it...

i am not normal, no really.
MaTTFURY is offline   Reply With Quote
Old 13th December 2004, 23:33   #15
Cat Squared
Junior Member
 
Cat Squared's Avatar
 
Join Date: Jul 2004
Location: South Africa
Posts: 32
Shouldn't shit like this be put under the AVS\Presets forum???

Oh wait....guess who started this thread>>>>MaTTFURY
Cat Squared is offline   Reply With Quote
Old 13th December 2004, 23:47   #16
MaTTFURY
Major Dude
 
MaTTFURY's Avatar
 
Join Date: Jun 2004
Location: Australia,
Posts: 1,356
no point in holding a grudge to me i already feel like shit

i am not normal, no really.
MaTTFURY is offline   Reply With Quote
Old 14th December 2004, 00:41   #17
S-uper_T-oast
Forum King
 
S-uper_T-oast's Avatar
 
Join Date: May 2003
Location: Fnord?!
Posts: 2,657
Cat Squared,



And this is a plenty good fourm for this type of question.

About the cube, you don't need to go about and do all that stuff with planes like that, you just take a cube and use dots to draw a line all around it.
S-uper_T-oast is offline   Reply With Quote
Old 20th December 2004, 17:27   #18
Cat Squared
Junior Member
 
Cat Squared's Avatar
 
Join Date: Jul 2004
Location: South Africa
Posts: 32
Ahh its all fair in love and flaming MaTTFURY.

and its cool now...aiiight?
Cat Squared is offline   Reply With Quote
Old 20th December 2004, 19:10   #19
UnConeD
Whacked Moderator
 
UnConeD's Avatar
 
Join Date: Jun 2001
Posts: 2,104
code:
x = x1+0.2; y = y1+0.2; z = -0.2; //plane 1
x2 = x2-0.2; y2=y2-0.2; z2= 0.2 //plane2
x3 = x3+0.2; y3=y3+0.2; z3= -0.2 //plane 3
x4 = x4-0.2; y4 =y4-0.2; z4=0.2 //plane 4
x5 = x5+0.2; y5 = y5+0.2; z5 =-0.2 //plane 5
x6 = x6-0.2; y6 = y6-0.2; z6=0.2 //plane 6



What the heck is this supposed to do? The only variables that matter to a superscope are "x" and "y" as far as geometry goes. You need to output the points of your cube in order as "i" goes from 0 to 1.

AVS code consists of expressions and assignments, not equations.

UnConeD is offline   Reply With Quote
Old 20th December 2004, 20:19   #20
PAK-9
Major Dude
 
PAK-9's Avatar
 
Join Date: Oct 2002
Location: The United Kingdom of Great Britain and Northern Ireland
Posts: 1,374
Quote:
Originally posted by UnConeD
AVS code consists of expressions and assignments, not equations. [/B]
Well, except for movements and DM's

http://PAK-9.deviantart.com

...innit
PAK-9 is offline   Reply With Quote
Old 20th December 2004, 20:20   #21
hboy
Senior Member
 
hboy's Avatar
 
Join Date: Dec 2003
Location: Hungary
Posts: 217
Send a message via AIM to hboy
Quote:
Originally posted by UnConeD
What the heck is this supposed to do? The only variables that matter to a superscope are "x" and "y" as far as geometry goes. You need to output the points of your cube in order as "i" goes from 0 to 1.

AVS code consists of expressions and assignments, not equations. [/B]
The main problem is he does understand too little code, at least not enough for making nice presets. Maybe he doesn't understand anything, though I doubt that.
hboy is offline   Reply With Quote
Old 20th December 2004, 21:35   #22
MaTTFURY
Major Dude
 
MaTTFURY's Avatar
 
Join Date: Jun 2004
Location: Australia,
Posts: 1,356
my name is mattfury...

seriously though, what do you mean OUTPUT as in HOW?

i am not normal, no really.
MaTTFURY is offline   Reply With Quote
Old 21st December 2004, 12:21   #23
sidd
Major Dude
 
sidd's Avatar
 
Join Date: May 2003
Location: Australia
Posts: 1,353
mattfury: please don't take this the wrong way, but you are trying to get into a topic that is slightly beyond your understanding. You need to first develop a good understanding of how AVS works before you can start making 3d presets.

The following is not what you asked for, but please try it anyway, and PLEASE don't come back and ask about 3D again until you completely understand how this code works.

INIT:
code:

n=5 //the scope will have 5 points.



FRAME:
code:

point=0; //We use the variable "point" to count which
//corner we are up to in the per point section. We need to reset it
//each frame or it will keep increasing larger and larger.


angle=angle+0.01; //each frame we angle increases slightly so that the
//shape appears to rotate smoothly.


af=w/h //since the avs window isn't always square, we need
//to make sure our shape doesn't get stetched. To do this, we multiply
//the y axis by the width/height of the avs window (don't worry if you
//don't get it, just remember to do it)




POINT:
code:

//this section will be run 5 times every frame, one for
//each of the points on our scope. To keep track of which point we are up
//to, I have use the variable "point". eg. If point is equal to 0, we are
//up to the first point.

//look the line for tempX, if point is equal to 0, 3 or 4, tempX will
//be 0.5. otherwise it will be -0.5.
//tempY is similar, this is how we create our shape.

tempX=equal(point,0)+equal(point,3)+equal(point,4)-0.5;
tempY=equal(point,2)+equal(point,3)-0.5;

//this is the rotation sequence that you have probably
//already had explained to you. As i explained, "angle" is increasing
//slightly every frame, making the shape rotate around.

x=tempX*cos(angle)-tempY*sin(angle);
y=tempX*sin(angle)+tempY*cos(angle);

y=y*af;//see the note on af in the frame section

point=point+1;//go on to the next point.



There. feel free to ask questions about this. but don't go asking about 3D until you understand it all.

Last edited by sidd; 21st December 2004 at 13:02.
sidd is offline   Reply With Quote
Old 23rd December 2004, 08:33   #24
MaTTFURY
Major Dude
 
MaTTFURY's Avatar
 
Join Date: Jun 2004
Location: Australia,
Posts: 1,356
tempx/y are a variable or constant?

i am not normal, no really.
MaTTFURY is offline   Reply With Quote
Old 23rd December 2004, 09:31   #25
hboy
Senior Member
 
hboy's Avatar
 
Join Date: Dec 2003
Location: Hungary
Posts: 217
Send a message via AIM to hboy
Quote:
Originally posted by MaTTFURY
tempx/y are a variable or constant?
constant is a type of variable. there are mainly two types: constant (their values are added once and then left that way) variables and dynamic (their value is changed over time)variables.

guess of which kind are these then if you assign points to it like the way sidd did it, it is a constant variable because it is not dynamically changed. but if you would do it dynamically it would be a dynamic variable. i wont explain how you do it dynamically.
hboy is offline   Reply With Quote
Old 23rd December 2004, 21:23   #26
TomyLobo
Major Dude
 
TomyLobo's Avatar
 
Join Date: Feb 2004
Location: Germany
Posts: 580
actually, there are no "constant variables", because that'd be a contradiction

constants are:
$pi, $e and so on
numbers like 1.2345
and that's about it

variables are:
things like a, d, u, foo, moo,

some variables are pre-set by the component you write your code into (such as red, green, blue, b, i and v for SuperScope)
others are read by the component and evaluated for rendering (like n, red, green, blue, x, y and skip for SuperScope)

If you can't say something nice, say something surrealistic.
TomyLobo is offline   Reply With Quote
Old 24th December 2004, 05:41   #27
MaTTFURY
Major Dude
 
MaTTFURY's Avatar
 
Join Date: Jun 2004
Location: Australia,
Posts: 1,356
erm i know what all of those are... ok, back to the point... how would i make my code work with that code? another ssc? or rewrite my code?

i am not normal, no really.
MaTTFURY is offline   Reply With Quote
Old 24th December 2004, 08:37   #28
sidd
Major Dude
 
sidd's Avatar
 
Join Date: May 2003
Location: Australia
Posts: 1,353
You don't understand how my code works.

Ask about the bits you don't understand first, then move on to more complicated things.

To answer your first question, tempX and tempY are variables that are created the first time avs executes the per point code.

They are user defined, which means that they have no special meaning in avs. They are just a place created especially for this scope to store values which will be used later.

You could rename them to anything else, like x1 and y1, and it would do exactly the same thing.
sidd is offline   Reply With Quote
Old 24th December 2004, 10:29   #29
MaTTFURY
Major Dude
 
MaTTFURY's Avatar
 
Join Date: Jun 2004
Location: Australia,
Posts: 1,356
ok how do i get mine to work? im lost.... (your code, my code, everyones fucking code )

i am not normal, no really.
MaTTFURY is offline   Reply With Quote
Old 24th December 2004, 11:52   #30
^..^
Major Dude
 
^..^'s Avatar
 
Join Date: Sep 2004
Location: There
Posts: 1,002
Send a message via ICQ to ^..^
matt are you sure that you understood sidd's code? thats what you're supposed to do at first! Please do so and try to undesrtand this first step.
DAMN! YOU WONT UNDERSTAND EVERYTHNG AT ONCE!!!

^..^ is offline   Reply With Quote
Old 24th December 2004, 12:13   #31
sidd
Major Dude
 
sidd's Avatar
 
Join Date: May 2003
Location: Australia
Posts: 1,353
I am now utterly convinced that mattfury is nothing more than some evil psychology experiment designed to test people's theshold for idiocy.

i totally completely give up.
sidd is offline   Reply With Quote
Old 24th December 2004, 12:30   #32
^..^
Major Dude
 
^..^'s Avatar
 
Join Date: Sep 2004
Location: There
Posts: 1,002
Send a message via ICQ to ^..^
certainly! That would be the only logical explanation. How else could it be that someone asks for help and -instead of doing as he is told- always knows it better.

^..^ is offline   Reply With Quote
Old 24th December 2004, 13:01   #33
Warrior of the Light
Forum King
 
Warrior of the Light's Avatar
 
Join Date: Aug 2002
Location: The Netherlands
Posts: 4,079
Quote:
Originally posted by ^..^
[..] always knows it better.
true. Then let him answer his own question this time.

MaTT, What's your first idea on how to use this code?

Jesus loves you [yes, you] so much, he even died for you so that you will not need to die, but live forever
Warrior of the Light is offline   Reply With Quote
Old 24th December 2004, 14:15   #34
^..^
Major Dude
 
^..^'s Avatar
 
Join Date: Sep 2004
Location: There
Posts: 1,002
Send a message via ICQ to ^..^
probably he will contradict himself as well as he contradicts us

^..^ is offline   Reply With Quote
Old 24th December 2004, 21:23   #35
MaTTFURY
Major Dude
 
MaTTFURY's Avatar
 
Join Date: Jun 2004
Location: Australia,
Posts: 1,356
my first idea was from jaak he told me, faces of a cube, make that many square / lines then connect them

i am not normal, no really.
MaTTFURY is offline   Reply With Quote
Old 24th December 2004, 22:23   #36
^..^
Major Dude
 
^..^'s Avatar
 
Join Date: Sep 2004
Location: There
Posts: 1,002
Send a message via ICQ to ^..^
¿que? What he says?

^..^ is offline   Reply With Quote
Old 24th December 2004, 23:38   #37
MaTTFURY
Major Dude
 
MaTTFURY's Avatar
 
Join Date: Jun 2004
Location: Australia,
Posts: 1,356
make squares, connect them all

i am not normal, no really.
MaTTFURY is offline   Reply With Quote
Old 25th December 2004, 10:45   #38
Warrior of the Light
Forum King
 
Warrior of the Light's Avatar
 
Join Date: Aug 2002
Location: The Netherlands
Posts: 4,079
good idea, try it and then post the preset so we can help you further

Jesus loves you [yes, you] so much, he even died for you so that you will not need to die, but live forever
Warrior of the Light is offline   Reply With Quote
Old 25th December 2004, 23:50   #39
TomyLobo
Major Dude
 
TomyLobo's Avatar
 
Join Date: Feb 2004
Location: Germany
Posts: 580
think in your head, not on the forum, please
and please, learn step by step, do not try to learn the more complex things before learning the basics.

none of us did 3D presets in the first place. all of us had to learn how to code first

If you can't say something nice, say something surrealistic.
TomyLobo is offline   Reply With Quote
Old 26th December 2004, 01:50   #40
MaTTFURY
Major Dude
 
MaTTFURY's Avatar
 
Join Date: Jun 2004
Location: Australia,
Posts: 1,356
ok

i am not normal, no really.
MaTTFURY is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Visualizations > AVS

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump