Full Raytracer

user_icon Canthiar shared it 1 year, 3 months ago
1445 views, 22 people love it, 2 taggers, 236 downloads, in 9 galleries, 7 remixes
Add to my favorites?
Flag as inappropriate?

Comments

You need to be logged in to post comments

Add a Comment

Sidharth Sidharth 2 weeks, 6 days ago

that is complicated!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

(view all replies)
Comment Reply

sparkygirl sparkygirl 6 months, 2 weeks ago

cool

(view all replies)
Comment Reply

Scratchie Scratchie 6 months, 2 weeks ago

They look like Easter eggs!

(view all replies)
Comment Reply

messd002 messd002 6 months, 3 weeks ago

*Faint* OMG. Just downloaded code and, well, I can't say no more. Outstandingly incredible.

(view all replies)
Comment Reply

beandude202 beandude202 8 months ago

did you say several hours?

(view all replies)
Comment Reply

MrBananas MrBananas 9 months, 1 week ago

this is amazing. i just dont have the patience to wait for it to finish, though.

(view all replies)
Comment Reply

LeBurt LeBurt 9 months, 1 week ago

LeSam: I would appreciate you didn't leave comments when logged under my name. Use your own login! ;)

(view all replies)
Comment Reply

LeBurt LeBurt 9 months, 1 week ago

kewl!ckool cool kool kcool

(view all replies)
Comment Reply

LeBurt LeBurt 9 months, 1 week ago

boring but fun!weird but clever!

(view all replies)
Comment Reply

LeBurt LeBurt 9 months, 1 week ago

how long does it take?

(view all replies)
Comment Reply

Canthiar Canthiar 9 months, 3 weeks ago

This ray tracer makes no FOV calculations so without adding the proper calculations you can't change the FOV. If change the radius of the objects then they will change based on the size that you set them to. If the number is bigger then the objects will get bigger.

(view all replies)
Comment Reply

Canthiar Canthiar 9 months, 3 weeks ago

I don't collaborate much online, but I know people will post to code http://www.codeproject.com/ and http://sourceforge.net/. If you use Windows you can download Visual Studio Express for C and C++ programming. I've posted a link somewhere in the comments.

(view all replies)
Comment Reply

Oldschooler2 Oldschooler2 9 months, 3 weeks ago

One other question... if I edited the size of the "Rayobjects" (the soccer balls, that is) would it make the spheres drawn by the raytracer bigger or smaller, since it would change the field of view?

(view all replies)
Comment Reply

Oldschooler2 Oldschooler2 9 months, 3 weeks ago

By the by, how long ago did you add the black and white picture of the final image to the screen? When I 1st saw this, it did not have it.

(view all replies)
Comment Reply

Oldschooler2 Oldschooler2 9 months, 3 weeks ago

Uhh... the latter. The one you said that I could write my own. By the by, did you hear about "Scratch 1.2"? It has the square root thing in it, I hear. Then it would be a whole lot less cluttered, since you would not have so many "Set SquarerootNR to ...". The problem with that is it still finds the square root of negative numbers, which you and I both know, is impossible to calculate with real numbers.

(view all replies)
Comment Reply

Canthiar Canthiar 9 months, 3 weeks ago

BTW, yes it is now much faster. If you notice a comment that I made below I hinted that it might be possible to speed it up.

(view all replies)
Comment Reply

Canthiar Canthiar 9 months, 3 weeks ago

Your question was "Do you know a site where I can upload the C++ you use for Raytracers?" and I was looking for clarification since I wasn't sure if you wanted source code to an already written ray tracer or if you were looking to write your own and upload it somewhere.

(view all replies)
Comment Reply

Oldschooler2 Oldschooler2 9 months, 3 weeks ago

And what do you mean by "Are you looking for the C++ compiler or the source code for a ray tracer"? Could you describe what you are questioning?

(view all replies)
Comment Reply

Oldschooler2 Oldschooler2 9 months, 3 weeks ago

Say, this is a whole lot faster than last time. I downloaded it, and you seemed to have made it so all of the Rayobjects operate on "When I receive (distancetoobject1)".

(view all replies)
Comment Reply

Oldschooler2 Oldschooler2 9 months, 3 weeks ago

Uhh... which one lets me get started with them and create them?

(view all replies)
Comment Reply

Canthiar Canthiar 9 months, 3 weeks ago

Are you looking for the C++ compiler or the source code for a ray tracer?

(view all replies)
Comment Reply

Oldschooler2 Oldschooler2 9 months, 3 weeks ago

Do you know a site where I can upload the C++ you use for Raytracers?

(view all replies)
Comment Reply

Canthiar Canthiar 9 months, 3 weeks ago

I don't write ray tracers for my job, I just do it for fun in my spare time. The language that I use is C++.

(view all replies)
Comment Reply

Oldschooler2 Oldschooler2 9 months, 3 weeks ago

Say Canthiar, what computer programs do you use with Ray tracers in your occupation? You do have a degree from the University of Arkansas, so you should know what I mean. To clarify, you use this kind of math in your job, no? And which programs do you use applying this knowledge? Sorry for repeating myself, I just want to be clear about what I am talking.

(view all replies)
Comment Reply

Oldschooler2 Oldschooler2 9 months, 3 weeks ago

sorry, I meant to say they both wait until the signal "DistacetoObject5" is broadcasted from "RayObject4".

(view all replies)
Comment Reply

Oldschooler2 Oldschooler2 9 months, 3 weeks ago

It does work correctly, it is just both the "RayObject5" and the "RayObject6" sprites both wait until the message "Distance to object5". Sorry, I don't know how do describe it in words exactly.

(view all replies)
Comment Reply

Canthiar Canthiar 9 months, 3 weeks ago

Interesting catch. It may have just been something that I changed and forgot to put back. If it still works correctly that way then it might be possible to speed this program up a little bit.

(view all replies)
Comment Reply

Oldschooler2 Oldschooler2 9 months, 3 weeks ago

Download it and check the list broadcast signals on it's pull down list to see what I mean.

(view all replies)
Comment Reply

Oldschooler2 Oldschooler2 9 months, 3 weeks ago

One question now, why do both the Rayobject 5 and Rayobject6 operate on "When I recieve (Distance to object 5)." Originally, was the Rayobject6 sprite only supposed to operate on "when I recieve (distance to object 6).

(view all replies)
Comment Reply

Canthiar Canthiar 10 months ago

Yes, it is possible to draw things other than spheres.

(view all replies)
Comment Reply

Oldschooler2 Oldschooler2 10 months ago

Sorry for bothering you... ray tracers are rather interesting... both to do and to look at!

(view all replies)
Comment Reply

Oldschooler2 Oldschooler2 10 months ago

Hey, Canthiar, just curious: is it possible to create a ray tracer that draws something other than sphere (such as pyramids or other polyhedrons)? If not so, notify me.

(view all replies)
Comment Reply

Oldschooler2 Oldschooler2 10 months ago

(link to project) The link is another attempt at a Raytracer... if you can call it that... Download it and check the script.

(view all replies)
Comment Reply

Oldschooler2 Oldschooler2 10 months ago

I just did not understand that.

(view all replies)
Comment Reply

Oldschooler2 Oldschooler2 10 months ago

Sorry to disturb you again, but what did you mean by "mathematical model to intersect that ray with an object.", the comment you left on my "raytracer"?

(view all replies)
Comment Reply

Oldschooler2 Oldschooler2 10 months ago

Canthiar, what exactly about my "raytracer" does not make it a raytacer? What thing am I seemingly missing to make it a true raytracer?

(view all replies)
Comment Reply

Oldschooler2 Oldschooler2 10 months ago

Sorry I meant to say "see" not se.

(view all replies)
Comment Reply

Oldschooler2 Oldschooler2 10 months ago

(link to project) You will need to downoad it. Se it in presentation mode for the best image. Mine is faster than this but is a lot less complicated.

(view all replies)
Comment Reply

Canthiar Canthiar 10 months, 3 weeks ago

The slow down is a little bit more complicated than that. Yes, calculations can slow things down, but doing "Broadcast and Wait" and loops also slow scratch programs down. The main thing is that Scratch was meant to teach people how to write computer software, not do intensive programs.

(view all replies)
Comment Reply

JoelP JoelP 10 months, 4 weeks ago

things seem to run faster if you are giving a lot of different commands at a time instead of one big, complicated script. Your thing is amazing to see how complicated it is, but they could be faster.

(view all replies)
Comment Reply

Canthiar Canthiar 10 months, 4 weeks ago

I would love to make it run a lot faster so people don't spend so much time waiting on it, but everything I do to speed it up makes the scratch code harder to follow.

(view all replies)
Comment Reply

JoelP JoelP 10 months, 4 weeks ago

(for me)

(view all replies)
Comment Reply

JoelP JoelP 10 months, 4 weeks ago

sad

(view all replies)
Comment Reply

JoelP JoelP 10 months, 4 weeks ago

BTW, I watched the whole thing complete!

(view all replies)
Comment Reply

JoelP JoelP 10 months, 4 weeks ago

ok, sorry about over-reacting, its kinda complicated and skilled, i was actually in a bad mood at the time I was interested to find out about the thingy.

(view all replies)
Comment Reply

Canthiar Canthiar 10 months, 4 weeks ago

The background is just a preview of what it is about to draw. The picture is actually drawn using a set of mathematical formulas.

(view all replies)
Comment Reply

JoelP JoelP 10 months, 4 weeks ago

THIS IS A RAY TRACER?! I edited the background and it did the exact same thing as the normal one did! Am I saying you just put all the codes in there!? Tell me!

(view all replies)
Comment Reply

JoelP JoelP 11 months ago

this is taking so long, I think I will just continue scratching and see what it is once it is done

(view all replies)
Comment Reply

Canthiar Canthiar 11 months ago

How many are you talking about? If it's just one then it isn't that bad, but it would be fairly slow. I think it would take a lot of work to do more since Scratch doesn't have arrays.

(view all replies)
Comment Reply

BabbageHaxor BabbageHaxor 11 months ago

How hard would it be to write a program that does flat shaded polygons in 3d?

(view all replies)
Comment Reply

Canthiar Canthiar 11 months, 1 week ago

Forum topic started here: (link to forums)

(view all replies)
Comment Reply

Oldschooler2 Oldschooler2 11 months, 1 week ago

To reply to the comment you left me on my 3D Raytracer, I say yes. I think it will be most effective for me in understanding these functions in computer programming. It interests me about the effort and math smarts you apply into your raytracers.

(view all replies)
Comment Reply

Oldschooler2 Oldschooler2 11 months, 1 week ago

By the by, Check out my attempt at a raytracer (the project's called 3D Raytracer).

(view all replies)
Comment Reply

Oldschooler2 Oldschooler2 11 months, 1 week ago

Thats a whole lot faster than I thought (I thought it was 9 hours).

(view all replies)
Comment Reply

Canthiar Canthiar 11 months, 1 week ago

Depending on how fast your computer is it can take somewhere between 2 to 4 hours.

(view all replies)
Comment Reply

Oldschooler2 Oldschooler2 11 months, 1 week ago

Hey, Canthiar, how long does this take to finish, just out of curiosity?

(view all replies)
Comment Reply

Oldschooler2 Oldschooler2 11 months, 1 week ago

Wow. This project has it all, Canthiar!

(view all replies)
Comment Reply

Canthiar Canthiar 11 months, 2 weeks ago

The shades just happen on their own based on the fact that it is a curved surface. I just programmed up how much each illumination model reacts to the curvature. The 3D rendering in video games are similar, but they work by rendering triangles instead of individual pixels.

(view all replies)
Comment Reply

Oldschooler2 Oldschooler2 11 months, 2 weeks ago

So you programmed this almost like a 3D video game where there is different shades of lighting in certain areas.

(view all replies)
Comment Reply

Canthiar Canthiar 11 months, 2 weeks ago

Ambient, diffuse, and phong are different illumination models. Ambient is base light applied to all objects. It is the darkest that an object can get, it's meant to model all reflected light in the scene. Diffuse is the basic light model. If the surface is facing a light it is bright, if it is facing away then the surface is dark. Phong is a specular hightlight model. It sets how shiny the surface is toward a light source. If the phong value is high then the surface has a bright shiny spot. If the phong size is high then the shiny spot is very large.

(view all replies)
Comment Reply