This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-10-20 00:12:06

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Ray Tracer in Java

Yup.  Actually getting close to done...all I really need to do is lighting and a few touch ups and I should be good.  I'll post pictures soon.


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#2 2012-10-20 05:07:13

Gravitation
New Scratcher
Registered: 2012-09-26
Posts: 500+

Re: Ray Tracer in Java

Cool!  big_smile  Can't wait to see it.

Offline

 

#3 2012-10-20 06:14:55

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: Ray Tracer in Java

awesome :3


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#4 2012-10-20 12:27:28

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: Ray Tracer in Java

Oh, awesome. I'm currently learning Java, I really should start learning to use graphics libraries. Maybe LWJGL.

Mind releasing the source code? It could help me eventually ;P


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#5 2012-10-20 12:30:44

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Ray Tracer in Java

technoguyx wrote:

Oh, awesome. I'm currently learning Java, I really should start learning to use graphics libraries. Maybe LWJGL.

Mind releasing the source code? It could help me eventually ;P

Well...I can refer you to the video I found about rendering pixels in a window using JFrame...since I'm making my ray tracer able to trace almost any shape, it'd be a little hard to release all of it cuz it's a lot.


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#6 2012-10-20 12:37:05

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: Ray Tracer in Java

Oh, okay then. Anything helps  wink


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#7 2012-10-20 13:08:11

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Ray Tracer in Java

Basic Rendering (Just intersection):

http://i45.tinypic.com/1195don.png

Time Rednering (Based off the time it takes the ray to get to the object + some ambient light):

http://i45.tinypic.com/9bk5dg.png

As you can see, time-based rendering looks a lot nicer.  smile


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#8 2012-10-20 13:16:06

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: Ray Tracer in Java

Much nicer, indeed. Longer time (which I suppose is the distance between the ray's origin and it's intersection with the object) = darker?


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#9 2012-10-20 13:39:18

slinger
Scratcher
Registered: 2011-06-21
Posts: 1000+

Re: Ray Tracer in Java

Wow, nice!


http://s0.bcbits.com/img/buttons/bandcamp_130x27_blue.png

Offline

 

#10 2012-10-20 13:42:13

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Ray Tracer in Java

technoguyx wrote:

Much nicer, indeed. Longer time (which I suppose is the distance between the ray's origin and it's intersection with the object) = darker?

Yep! But there are limits on either side.  The maximum limit on the brightness is 1 (because that's the highest float that can be taken so otherwise it would take the remainder which doesn't look good) and the minimum is the ambient light present (I believe I used .1).


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#11 2012-10-21 22:56:47

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Ray Tracer in Java

Lighting Update:

http://i50.tinypic.com/6pyxp3.png

Still not perfect but looks a lot better!


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#12 2012-10-21 23:17:26

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: Ray Tracer in Java

AtomicBawm3 wrote:

Lighting Update:

http://i50.tinypic.com/6pyxp3.png

Still not perfect but looks a lot better!

wow! It's going to be awhile before I understand what math goes into it... How long did it take to render the image?

Offline

 

#13 2012-10-21 23:37:58

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: Ray Tracer in Java

Wow, awesome.  big_smile  The specular looks a bit big, though  tongue

Also,

AtomicBawm3 wrote:

Well...I can refer you to the video I found about rendering pixels in a window using JFrame.

Please?  tongue

Last edited by technoguyx (2012-10-21 23:38:48)


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#14 2012-10-22 07:48:21

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Ray Tracer in Java

TorbyFork234 wrote:

AtomicBawm3 wrote:

Lighting Update:

http://i50.tinypic.com/6pyxp3.png

Still not perfect but looks a lot better!

wow! It's going to be awhile before I understand what math goes into it... How long did it take to render the image?

Not long at all....you can almost do real-time rendering.  Here's the vid: https://www.scratch.mit.edu/ext/youtube … ata_player


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#15 2012-10-23 04:25:11

slinger
Scratcher
Registered: 2011-06-21
Posts: 1000+

Re: Ray Tracer in Java

I can't seem to view the video  hmm


http://s0.bcbits.com/img/buttons/bandcamp_130x27_blue.png

Offline

 

#16 2012-10-23 09:30:33

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: Ray Tracer in Java

Can't seem to, either... lemme try

EDIT: That works c:

Last edited by technoguyx (2012-10-23 09:31:07)


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#17 2012-10-23 09:36:15

slinger
Scratcher
Registered: 2011-06-21
Posts: 1000+

Re: Ray Tracer in Java

That doesn't look like the right one  hmm


http://s0.bcbits.com/img/buttons/bandcamp_130x27_blue.png

Offline

 

Board footer