Faster ray tracer With shadow

Install Java to view this project right on your browser!

user_icon Canthiar shared it 5 years ago
user_icon Based on Canthiar's project
750 views, 1 tagger, 8 people love it, 1 remix by 1 person, 80 downloads, in 3 galleries
Add to my favorites?
Flag as inappropriate?

Comments

You need to be logged in to post comments

Add a Comment

 
edyensid edyensid 4 years ago

wait, nevermind, i am guessing these were done is a version older than 1.2.1? i see now that 'Numbers' has a block with dropdown for all kinds of Math functions, abs, cos, sin, etc... so does that mean that a red colored block is one that isnt supported anymore, or is from an older version?

Canthiar Canthiar 4 years ago

That's correct, it's a block that is no longer supported.

edyensid edyensid 4 years ago

i want to know where the red 'abs' block came from?

bartybacon bartybacon 4 years ago

Canthiar, can you explain to an newbie (me) how you do this?

Canthiar Canthiar 4 years ago

If you can follow along with all of the math then you can read up on how I did it in this forum post: (link to forums)

fujo123456789 fujo123456789 4 years, 4 months ago

i dont get it ur a super genius (if i spelled right)

raymond1234321 raymond1234321 4 years, 5 months ago

...can you explain what to do? I don't get it.

Canthiar Canthiar 4 years, 8 months ago

Because it doesn't use the x position to set the color. The square root is used as part of the calculation to get the length of the ray from the camera to the surface it is colliding with. It is also used to make sure that the ray used to calculate the lighting has a length of 1.

Oldschooler2 Oldschooler2 4 years, 8 months ago

Hey Canthiar, why does this need a square root variable? Couldn't you just tell the ray tracer something like "if x position is greater than such and such and less than such and such, set pen color to, say, blue"?

Canthiar Canthiar 4 years, 10 months ago

Ray casting and ray tracing are fairly similar. If you're talking about the way Doom rendered, if I remember correctly, it only did a single cast in the vertical plane, but did a cast for each pixel on the horizontal plane. It might be possible, but I think it would still be too slow for Scratch to render in real time.

S65 S65 4 years, 10 months ago

but it has much less detail.

S65 S65 4 years, 10 months ago

Would it be possible to do a ray caster in Scratch? I don't know all the technical details, but I think ray casting is much much faster than ray tracing.

Babygirl Babygirl 4 years, 10 months ago

WOWIE

Dancer Dancer 4 years, 10 months ago

i dont get it

Canthiar Canthiar 4 years, 12 months ago

I actually have a full time job writing software. You shouldn't worry about it too much and enjoy being young and having no responsibilities.

gow123 gow123 4 years, 12 months ago

oh wow.im not even close to having one.

Canthiar Canthiar 4 years, 12 months ago

Yes, I do.

gow123 gow123 4 years, 12 months ago

Canthiar,you have a job?

Canthiar Canthiar 4 years, 12 months ago

I guess it's just all stuff that I've had experience with at some point in the past.

Dragon_MC_ Dragon_MC_ 5 years ago

*gaping* Great programming. How'd you come up with all of this? I love it.

Canthiar Canthiar 5 years ago

It's not an interactive game. Ray tracing is a computationally intensive way of rendering graphics using 3D math.

jamesbond13 jamesbond13 5 years ago

i dont get it...

Canthiar Canthiar 5 years ago

Yes, it does. I used to be bad at math, but I got better. Now I use it every day for my job.

Wubby Wubby 5 years ago

Math rocks!

Giantfishy Giantfishy 4 years ago

I agree.

(view all replies)
Please Wait...