Winamp & Shoutcast Forums > AVS cube-E question

 7th December 2004, 00:30 #1 MaTTFURY Major Dude     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.
 7th December 2004, 06:19 #2 hboy Senior Member     Join Date: Dec 2003 Location: Hungary Posts: 217 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.
7th December 2004, 07:57   #3
Jaak
Major Dude

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

 7th December 2004, 11:11 #4 hboy Senior Member     Join Date: Dec 2003 Location: Hungary Posts: 217 oops totally agreed Jaak, i forgot that and yeah it is also easier to sync 6 squares too
 8th December 2004, 01:30 #5 TomyLobo Major Dude     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.
8th December 2004, 01:45   #6
TomyLobo
Major Dude

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
 cube.gif (486 Bytes, 174 views)

If you can't say something nice, say something surrealistic.

 8th December 2004, 01:45 #7 Xerol Junior Member   Join Date: May 2004 Location: Timonium, MD Posts: 27 Actually, all you really need are two parallel squares and 4 connecting lines.
 8th December 2004, 01:46 #8 TomyLobo Major Dude     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.
8th December 2004, 04:43   #9
Jaak
Major Dude

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

 8th December 2004, 21:29 #10 MaTTFURY Major Dude     Join Date: Jun 2004 Location: Australia, Posts: 1,356 could you explain it better please? i am stupid! i am not normal, no really.
 9th December 2004, 07:28 #11 hboy Senior Member     Join Date: Dec 2003 Location: Hungary Posts: 217 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
 9th December 2004, 16:35 #12 PAK-9 Major Dude     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
9th December 2004, 19:02   #13
hboy
Senior Member

Join Date: Dec 2003
Location: Hungary
Posts: 217
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.

 10th December 2004, 06:55 #14 MaTTFURY Major Dude     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.
 13th December 2004, 23:33 #15 Cat Squared Junior Member     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
 13th December 2004, 23:47 #16 MaTTFURY Major Dude     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.
 14th December 2004, 00:41 #17 S-uper_T-oast Forum King     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.
 20th December 2004, 17:27 #18 Cat Squared Junior Member     Join Date: Jul 2004 Location: South Africa Posts: 32 Ahh its all fair in love and flaming MaTTFURY. and its cool now...aiiight?
 20th December 2004, 19:10 #19 UnConeD Whacked Moderator     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.
20th December 2004, 20:19   #20
PAK-9
Major Dude

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

20th December 2004, 20:20   #21
hboy
Senior Member

Join Date: Dec 2003
Location: Hungary
Posts: 217
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.

 20th December 2004, 21:35 #22 MaTTFURY Major Dude     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.
 21st December 2004, 12:21 #23 sidd Major Dude     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.
 23rd December 2004, 08:33 #24 MaTTFURY Major Dude     Join Date: Jun 2004 Location: Australia, Posts: 1,356 tempx/y are a variable or constant? i am not normal, no really.
23rd December 2004, 09:31   #25
hboy
Senior Member

Join Date: Dec 2003
Location: Hungary
Posts: 217
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.

 23rd December 2004, 21:23 #26 TomyLobo Major Dude     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.
 24th December 2004, 05:41 #27 MaTTFURY Major Dude     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.
 24th December 2004, 08:37 #28 sidd Major Dude     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.
 24th December 2004, 10:29 #29 MaTTFURY Major Dude     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.
 24th December 2004, 11:52 #30 ^..^ Major Dude     Join Date: Sep 2004 Location: There Posts: 1,002 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!!!
 24th December 2004, 12:13 #31 sidd Major Dude     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.
 24th December 2004, 12:30 #32 ^..^ Major Dude     Join Date: Sep 2004 Location: There Posts: 1,002 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.
24th December 2004, 13:01   #33
Warrior of the Light
Forum King

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

 24th December 2004, 14:15 #34 ^..^ Major Dude     Join Date: Sep 2004 Location: There Posts: 1,002 probably he will contradict himself as well as he contradicts us
 24th December 2004, 21:23 #35 MaTTFURY Major Dude     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.
 24th December 2004, 22:23 #36 ^..^ Major Dude     Join Date: Sep 2004 Location: There Posts: 1,002 ¿que? What he says?
 24th December 2004, 23:38 #37 MaTTFURY Major Dude     Join Date: Jun 2004 Location: Australia, Posts: 1,356 make squares, connect them all i am not normal, no really.
 25th December 2004, 10:45 #38 Warrior of the Light Forum King     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
 25th December 2004, 23:50 #39 TomyLobo Major Dude     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.
 26th December 2004, 01:50 #40 MaTTFURY Major Dude     Join Date: Jun 2004 Location: Australia, Posts: 1,356 ok i am not normal, no really.
 Winamp & Shoutcast Forums > AVS cube-E question