Insolent_Chimp
9th May 2004 05:03 UTC
Three Diseducationated Question
Just two questions that have been picking at my brain:
1.) What does raytraced mean?
&
2.) What is this megabuf thingy? I see no mention of it in the SSC help...
pir can you help a monkey out? I see you using it in that Irradiation preset that you told me to look at.
By the by, if anyone who responds to this could please keep in mind that I'm just a chimp who has access to a lab computer after the scientist goes home. So I won't understand you if you start talking about math and code as if I were your peer. I am simian! :p
fsk
9th May 2004 05:30 UTC
raytraced is as the name implies all about traceing rays:) (who would have thought;) ).
The basic concept is that you shoot rays through every pixel on the screen (they all start from a single point somwhere in front of the screen) and look where it (the ray - a straight line) colides with an object (plane, sphere or whatever). with that you get the coordinate of the point on the object that can be seen in that pixel of the screen. from the coordinate you calculate the color of that pixel and in the end get a picture of the object on the screen.
ill let somone else explian the megabuff because i already proved i cant explain arrays:)
TomyLobo
9th May 2004 11:29 UTC
megabuf IS in the SSC help
under functions
basically it's an array of up to 1000000 (with indices from 0 to 999999) values. you can read from that array using "variable=megabuf(index);" and write into it by using "assign(megabuf(index), value);"
There is also a gmegabuf which can contain another 1 million values. The only difference between the 2 is that gmegabuf is valid global, i.e. it is the same in your whole preset, while megabuf is local, which means that you have one megabuf for each SSC/DM/whatever.
btw. this should be in the faq :)
hungryskull
9th May 2004 22:12 UTC
[edit] can't delete for some reason, ignore this. Wrong info.[/edit]
Shock Value
10th May 2004 06:25 UTC
... i already proved i cant explain arrays
Actually I think that explanation was pretty good. I_C, just remember that "shooting rays" does not imply emitting some kind of visual rays that you can see, but solving mathematical equations. It's all based upon using math to figure out where an imaginary line intersects some kind of other 3D shape, like a sphere or a flat plane.
Insolent_Chimp
10th May 2004 07:25 UTC
Okay, lemme see if I dig this raytracing thing now. So (and not exactly) it's sort of like how a TV tube draws a picture except you aren't using light-instead: an imaginary line-and your screen can be whatever shape you decide. I take it that the collision point on the object is actually just the end of the ray, or am I assuming too much?
Now the use of this would be..? Shading objects?
Still hazy on the megabuf function...What are arrays?
Thanks guys.
Warrior of the Light
10th May 2004 10:30 UTC
An array is like a collection of variables:
[_][_][_][_][_][_][_][_][_... [_]
0 1 2 3 4 5 6 7 8... 999999
Every position number (address) is like a variable and therefor it can contain something.
piR
10th May 2004 13:27 UTC
As ';-c ,rattaplan' tells you, an array is a collection of values. You can access to each of these values using an index (0 for the first, 1 for the second, and so on).
To write or to read in this array, you must use the megabuf() function (or gmegabuf() for the global array) like this:
my_var = megabuf(18); // put the value of the 19th element in my_var
megabuf(18) = my_var; // put the value of my_var in the 19th element
As a simple example, here is how you can set the 100 first elements with a random value between 0 and 255:
m=0; // first value of the index
for(100, exec2( assign( megabuf(m), rand(256) ),
assign(m,m+1) // to increment the index
)
);
Hope this can help you ... and others ...
sidd
10th May 2004 15:45 UTC
megabuf(0) is a variable, just like using "foo" or "blah" in avs. You can store numbers into it, and get the back later.
But, megabuf(1) and megabuf(2) and megabuf(12341) are also variables, and they can each store completely different values.
so basically, and array is a whole bunch of variables referenced by one name (in this case "megabuf"). And the way you get at the different variables is by using an index (the 1, 2, 12341 part).
The great thing about this is, you can use another variable as the index, like:
foo=99;
x=megabuf(foo);
that would put the value stored in megabuf(99) into x, since foo is equal to 99.
the only time you cant use megabuf(x) like an ordinary variable, is when you are putting the values in it (when megabuf is on the left of the equals sign):
megabuf(1)=1000;
doesnt work.
use this instead:
assign(megabuf(1),1000);
piR
11th May 2004 01:23 UTC
Ooops !
You're absolutely right Sidd, I wrote a stupid thing !
megabuf() can only be used on the right side of an assignment, or with the assign() function.
One more thing : even if megabuf(0) is really the first element of the array, it is sometime more simple to forget it and to consider that megabuf(1) is the first. In that case, one element is unused, but there are still 999.999 others available ;)
hungryskull
11th May 2004 01:30 UTC
Quote:
That's pretty close. And yes, the ray does end where it hits something.
As for the use, you know all those presets with really cool solid shapes or tunnels, that's usually raytracing.
Okay, lemme see if I dig this raytracing thing now. So (and not exactly) it's sort of like how a TV tube draws a picture except you aren't using light-instead: an imaginary line-and your screen can be whatever shape you decide. I take it that the collision point on the object is actually just the end of the ray, or am I assuming too much?
Now the use of this would be..? Shading objects?
|
Warrior of the Light
11th May 2004 10:25 UTC
@piR: No offence, but read my sig...
piR
11th May 2004 12:26 UTC
Ok ;-c ... but, what's written just above your avatar ... ;)
Anyway, the next time, I'll try to remember ...
Warrior of the Light
13th May 2004 15:28 UTC
Not only that, It's gonna leave soon anyway, as my new nickname is Warrior of the Light, (see my devartacount too: http://wotl.deviantart.com ) but I guess that's too many characters for the forums to handle... I intend to start using it when my new pack comes out; Don't ask for a date though, I'm not in a hurry ;)
jheriko
14th May 2004 05:53 UTC
Rays don't have ends. The word ray is infact an unrequired spurrious term that only serves to confuse us all.
You know what a line is? Thats a ray. No beginning no end, just a big line. x=y=z for instance is a ray. The term ray is usually used to refer to the *vector equation* for a line
(ox) (dx)
(oy) + t.(dy)
(oz) (dz)
where ox,oy,oz is the camera position and dx,dy,dz are the varying rates of change on x y and z. typically we use dz=1 and dx=x,dy=y. this means that at the centre of the screen we get no change in dx or dy so we shoot the ray through the middle of the screen. if we are somewhere else though then every 1 unit through z results in moving dx and dy units in x and y. This way we create the view frustrum out of rays that pass through the DM gridpoints at t=1 and extend out infinitely in both directions through the virtual world. Then we simply use some simultaneous equations to get out parameter 't' for how far along the ray we must go before we hit something. Then using the distance away from us everything is we warp and size the texture to make it look as if it covers the object being raytraced.
rattaplan/winkingvampire/;-c/wotl/whatever: please can you think up a name which is not totally moronic. actually... rattaplan isn't bad, the rest are just stupid. and yes i mean that, i won't take it back and you can get me banned if you want, i don't care, you have a really stupid collection of names there... sort it out. i don't mean to offend... well i do... but only in the interest of you not looking like a prat.
Warrior of the Light
14th May 2004 11:29 UTC
You're allowed to have an opinion...
I've used rattaplan for a few months only, but decided to dump it for the stupidity of the dog (Lucky Luke's prisondog, Luuk is my first name) that was in 2000. I didn't want to compare myself to it. Next came ;-c (july 2002) but no webbrouwser supported that so for my website I wrote it out to Winkingvampire (nov 2002). Years later (2004), being a christian I wanted to get rid of my vampire stuff and with that my nickname and so Warrior of the Light was born.
And if anyone else likes it or not is not my concern. Really. Thanks for the warning though. Sorry for you, but I'll stick with this one.
sidd
15th May 2004 08:48 UTC
You didnt want your name to be winking vampire because you are christian?
wtf?
whether or not you are christian doesnt change the fact that VAMPIRES ARE FICTIONAL!!
Tuggummi
15th May 2004 11:48 UTC
Though you gotta wonder why does every fictional story that has some sort of a human eating thing in it, promises eternal life for the one who practises it? (see?! watching X-files does pay off!)
Warrior of the Light
15th May 2004 13:12 UTC
@ sidd - This is also because the satanistic gothic (dressed like vamps sometimes) guys I know asked me about it and I couldn't deny that it just doesn't suit me as a christian.
@ tugg - You don't neccesarily have to eat humans... I've got eternal life too, but in another way. :p
sidd
15th May 2004 17:40 UTC
Its just a nickname!!, and its a nickname regarding a completely fictional character. Labeling your 'goth' friends as satanists doesnt help your case.
No one here thinks that you having a nickname to do with vampires makes you a spawn of satan. More to the point, no one here think you having a nickname like "warrior of the light" makes you a soul saving, son of God.
Back to the matter.. its only a nickname, and its a nickname that seems to keep changing. I, as a reprisentative of the entire community's thoughts (who need to refer to you in some manner from time to time), would like to see it settle to a static. Thus, i shall continue to refer to you as rattaplan.
K?
im soooooooOOOoooo drunk right now
hungryskull
16th May 2004 00:58 UTC
Jheriko: Thanks for clearing that up, I always thought that in raytracing, the ray starts at ox,oy,oz and ends at the collision point. Guess that shows what I know.
Another thing: Just for clarification purposes, t or k or whatever you call it, doesn't always have to be one.
Warrior of the Light
16th May 2004 13:31 UTC
Just to end this discussion and set things straight - I didn't label all my goth friends satanistic. Just some of them who really are.
And I mainly intended to change it because ->I<- didn't want it anymore. - And to stick with my new nick forgood, but you can call me whatever you want to... up to a certain limit of course that is.
(by the way, good luck with that hangover) :)