Rick Swift & Apple & Embedded I make things. Sometimes, I’ll talk about it here.

My Gorram Frakking Blog

RayTracing is Fun

CS184's assignment due a few hours ago was a simple ray tracer. So far, the most work, but also the most fun. I implemented a ray tracer that supports ellipsoids and triangles, point lights and directional lights (oops, forgot to mention that to the reader…hope (s)he picks up on that from the images), subsample antialiasing (jittered). It also renders to the screen and outputs jpeg directly, and uses an ANTLR-generated parser to read in scene files. Here are the images I submitted along with my assignment.

Some represent mistakes, but they're interesting anyway. I thought my images were cool, but Sarah Beth's snow globe takes the cake. Creative and refractive. How cool is that?

00Sphereslambert

01Withmatricesyeah

02Withmatricesbetter-1

02Zfirstattemptatellipsoid-1

03Scalingooops-1

05Shinyegg-1

04Scalingspherewormthing-1

08Allprim-1

10Basicprims-1

09Allprimabove-1

06Redspheregreenegg-1

07Reflectiveandegg-1

11Depth0-2

11Depth1-2

11Depth2-2

11Depth3-2

11Depth4-2

11Depth5-2

11Depth6-2

11Depth7-1

11Depth8-1

11Depth8Antialiased-1

12Phongexptest-1

12Phongexptestsubsamp-1

13Primssubsampled-1

14Xmasballfamily-1

I Always Thought the Japanese Were Smarter than We Americans

But not I'm not so confident of the assessment. Sure, they've got some wacky cultural surprises (Japscat? Eeesh), but generally the Japanese employ wisdom and elegance in their endeavors. So, why would they jump on the same wasteful space exploration initiative as the U.S.? Why take two decades to go to the moon, when they could go straight to Mars in half that time?

Our political leaders need to recognize the merits of a human Mars exploration program, and they need to set the goal of accomplishing serious scientific research on Mars.

If this works, Ecto kicks ass

I'm not sure how to use it yet, but I'll give it a try. Hopefully it will play nicely with SmartyPants.

This is some indented text. Dunno if it's really block-quoted, or what. Hmm, no, not block-quoted, which means Ecto might restrict the HTML structure I can impose on my entries.

Now, let's see what the iTunes button does: Let Go from the album "Details" by Frou Frou. Cool. It inserts the currently-playing song. Not sure why that needs to be a button right here in the app, but I guess we're all likely to have lots of need to make emergency references to songs...

The Dish

Wonderful movie. Funny and inspiring.
And it contains a great quote: "Failure is never quite so frightening as regret."

Assignment: Trace Rays

The current CS184 assignment is to write a ray tracing program. In typical fashion, I can't help but want to do all sorts of unnecessary stuff, like provide an ANTLR grammar for the scene description language, and a full-blown Mac application for rendering and displaying the images.
We're supposed to render axis-aligned ellipsoids and polygons only. We need to support simple Phong shading, shadows, reflections, point and directional lights, and some sort of ray test acceleration. We also have to save images in some standard format. Along with the code, we're to provide five or more example images. I'll try to remember to post them here when I'm done, so you, too, can enjoy the glory.
I made the mistake of looking at some POVRay example images. My renderer will never be this cool, so I'm mostly just depressed about the assignment now.