Archive: do you want to read this...i think so


8th April 2003 01:34 UTC

do you want to read this...i think so
ok so first of all...im a noob. haha, please make fun of me.
now heres the deal
-begin-
sqr(x)=(1/bc)(bi+(ay-aj))(ci+(az-ak));
sqr(y)=(1/ac)(aj+(bx-bi))(cj+(bz-bk));
sqr(z)=(1/ab)(ak+(cx-ci))(bk+(cy-cj));
-end-
I know how I want it too look, or how I think it should look. I dont know how to display it. PLEASE, help. thanks
skopii411@aol.com


8th April 2003 02:47 UTC

Originally posted by SkoPii411
ok so first of all...im a noob. haha, please make fun of me.
You stinky n00b. Why do you want us to make fun of you? Too bad for you, Atero isn't here.:p

I don't know what all those a[letter] and b[letter] and c[letter] things are, but it isn't too difficult for me to try and explain what you want to do.
You have to solve for x, y, and z(although you actually want these to be called something else - most likely x1, y1, and z1) - simple enough. Then you have to actually give all those variables values - you can just plug in the numbers you want to use, or you can write equations for them so that they aren't constant. These equations can use any variable that you want - you can pick from the predefined ones or make some more of your own. For example, a common variable is t - used for time - which is incremented each frame(t=t+.01 for example).
The hardest part is the 3D rotation and projection so that you can get the nice 2D coordinates. I'll leave this part up to you - just search the forums and you will find plenty of threads on how to convert 3D to 2D and do the rotations. If you find a post by Atero, check his signature for a link to his AVS Primer - this has some good things that could help you.

8th April 2003 02:51 UTC

3d projection isn't that hard,Anubis.


8th April 2003 03:09 UTC

Yeah, but figuring out how to do the rotation is harder than anything else in this problem.


8th April 2003 03:45 UTC

but I cant even get this to display in superscope. why not? Im sure im just retarded


8th April 2003 03:48 UTC

thank you for the help anubis.


8th April 2003 04:47 UTC

I assume you've already defined the other variables, so I won't go into them.

AVS only recognises the base variables in a statement. You're familiar with transposing equations and stuff, yes? It should probably read like this:

x=sqrt((1/bc)(bi+(ay-aj))(ci+(az-ak)));
y=sqrt((1/ac)(aj+(bx-bi))(cj+(bz-bk)));
z=sqrt((1/ab)(ak+(cx-ci))(bk+(cy-cj)));

I'm not sure if that's right though. Can anyone who's good with numbers check it? (I promise, I'll get into researching this stuff once I finish my break after the MiniPaks are done! :p)

BTW, z is a user variable, not an AVS variable, so you would want to translate it into a 2D space like this example (BTW, this won't account for rotation):

init:
n=200; pi=acos(-1);

point:
x1=sin(pi*i*2);
y1=v/2; z1=cos(pi*i*2);
x=x1/(1+z1); y=y1/(1+z1);

Apparently though, this method isn't the best to use. Can't see why, it works fine for me.

Hope that gets you at least started.


8th April 2003 06:49 UTC

when you code in any language you cant use:

sqr(x)=something as when the language reads it, it would consider sqr(x) as a variable and store 'something' in the memory.
what you should code is not an equation, you should give values to the variable.
I hope I am right :eek:


8th April 2003 08:55 UTC

you have to make your own variables and state what they will do,superscope knows only x,y.And...what exactly do you want it to show ?


8th April 2003 12:13 UTC

Yes UnDefineD, but that doesn't do the rotation, and 3D objects are hard to see without rotation. That's what makes 3D->2D difficult at all.


8th April 2003 12:24 UTC

Originally posted by anubis2003
but that doesn't do the rotation
I said that.

8th April 2003 12:33 UTC

Sorry, didn't see that. Anyways, if you want to know how to do the rotation - look it up. It's posted many times in these forums.


8th April 2003 13:02 UTC

I'm not sure what your code refers to (i,j,k remind me of quaternions, or maybe 3 base vectors), but the git of it is this:

Most computer code looks like math expressions, but actually it isn't. You just define a set of instructions to calculate something, like as you would type it on a (simple) calculator.

For example:
sqr(x) = 4

Is not good. You're saying: "The square of x equals 4". This is a statement, not a set of instructions. The part left of the '=' is the container/variable for the result and can only be a name. Instead, it has to be this:

x = sqrt(4)

Now you're saying: "take the square root of 4 and put it into x". This is something the computer can understand because it's a set of instructions.


In a superscope, you have to calculate a set of (x,y) coordinates for every point. The scope will then draw these points (or connect them with lines). So if you want 3D, you'll have to do the projection yourself. Want to do voxels? Have fun tracing'em!
First, get started with basic shapes and most importantly: how to make them move around the way you want them to move around.
Typing random equations has resulted in some cool presets, but most of the time it's better to know what you're doing so you understand why typing x=cos(i*10)*i;y=sin(i*10)*i results in a spiral.