Faster ray tracer With shadow

user_icon Canthiar shared it 1 year, 3 months ago
629 views, 7 people love it, 1 tagger, 52 downloads, in 2 galleries, 8 remixes
Add to my favorites?
Flag as inappropriate?

Comments

You need to be logged in to post comments

Add a Comment

edyensid edyensid 4 months 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?

(view all replies)
Comment Reply

Canthiar Canthiar 4 months ago

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

(view all replies)
Comment Reply

edyensid edyensid 4 months ago

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

(view all replies)
Comment Reply

bartybacon bartybacon 4 months ago

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

(view all replies)
Comment Reply

Canthiar Canthiar 4 months 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)

(view all replies)
Comment Reply

fujo123456789 fujo123456789 8 months, 1 week ago

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

(view all replies)
Comment Reply

raymond1234321 raymond1234321 8 months, 3 weeks ago

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

(view all replies)
Comment Reply

Canthiar Canthiar 11 months, 2 weeks 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.

(view all replies)
Comment Reply

Oldschooler2 Oldschooler2 11 months, 2 weeks 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"?

(view all replies)
Comment Reply

Canthiar Canthiar 1 year, 1 month 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.

(view all replies)
Comment Reply

S65 S65 1 year, 1 month ago

but it has much less detail.

(view all replies)
Comment Reply

S65 S65 1 year, 1 month 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.

(view all replies)
Comment Reply

Babygirl Babygirl 1 year, 1 month ago

WOWIE

(view all replies)
Comment Reply

Dancer Dancer 1 year, 2 months ago

i dont get it

(view all replies)
Comment Reply

Canthiar Canthiar 1 year, 3 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.

(view all replies)
Comment Reply

gow123 gow123 1 year, 3 months ago

oh wow.im not even close to having one.

(view all replies)
Comment Reply

Canthiar Canthiar 1 year, 3 months ago

Yes, I do.

(view all replies)
Comment Reply

gow123 gow123 1 year, 3 months ago

Canthiar,you have a job?

(view all replies)
Comment Reply

Canthiar Canthiar 1 year, 3 months ago

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

(view all replies)
Comment Reply

Dragon_MC_ Dragon_MC_ 1 year, 3 months ago

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

(view all replies)
Comment Reply

Canthiar Canthiar 1 year, 3 months ago

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

(view all replies)
Comment Reply

jamesbond13 jamesbond13 1 year, 3 months ago

i dont get it...

(view all replies)
Comment Reply

Canthiar Canthiar 1 year, 3 months ago

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

(view all replies)
Comment Reply

Wubby Wubby 1 year, 3 months ago

Math rocks!

(view all replies)
Comment Reply

Giantfishy Giantfishy 4 months ago

I agree.

(view all replies)
Comment Reply