My Octopress Blog

A blogging framework for hackers.

Film on the Rocks - Indiana Jones

If you have never been to Red Rocks, I encourage you to do so and Film on the Rocks is a great opportunity to make that happen. Jennifer and I went last night to see “Indiana Jones and the Last Crusade.”

I found out earlier this year that the location the powers-that-be chose for the final resting place of the Holy Grail was Petra (البتراء), located in Jordan. Living in the region, I’ve added to my growing list of places to visit. What I did not remember from seeing the movie as a child was the opening scenes where young Indiana steals an artifact from would-be pillagers. But now having been to Moab only weeks ago, I recognized the setting as Utah’s Arches National Park. I felt a strange sense of pride having seen the wilderness where Phuong and I spent three days in a pop-culture movie.

Arches DSC_0303.JPG Balancing Rock DSC_0465.JPG Caves

Washington D.C.

I’ve come out to the D.C. area for a workshop put on by the DOE, but that’s not until this weekend. In the mean time, I’ve been spending time with friends from high school (currently Michael in Annapolis, MD).

I got into town on the Fourth of July, and was fortunate enough to meet up with Michael and some friends before the fireworks. I’ve only been here a couple of times, but still I’ve never seen it so crowded. We got to watch from Pat’s parents’ boat, docked in the Potomac. Thanks again, Diane and Bill!

DSC_0018.JPG

We hung out, had some food and occupied ourselves with the overactive children. (Actually, we got a little peace and quiet when I handed the troublesome trio a logic game on the iPhone - they got so absorbed in it they sat calmly for two hours!)

DSC_0012.JPG

The fireworks started at a quarter past nine, but it was one of the weakest shows I’ve seen, though I’ve been spoiled by Mines’ E-Days display (if you ever have the chance to see that event, it is imperative that you do so).

DSC_0086.JPG

Be sure to check out the rest of the pictures from that event.

Moab - Arches National Park

Last week, Phuong and I went camping for a few days in Moab, UT. She had never been camping, and I’d never been in what I’d consider a real desert. Despite a few hiccups, it went relatively well.

Moab lives about 350 miles away from home or about 6.5 hours through mountain resorts and podunk towns. We got a late start and didn’t show up at our campsite until the early hours of the morning. Setting up the tent in the dark was not our problem - ours was one of being exhausted after the drive. Despite it all, the next day saw an enthusiastic start.

DSC_0037.JPG

Our first hike was the longest at the park, weighing in at about 7 miles. The rangers said we should plan on between 3 and 5 hours to hike it. With only about 1,000 feet in elevation change on the trail, we thought they must be crazy to think it would take that long. Four hours and two camelbacks later, we realize they were right.

In the desert, they recommend that each person drink 16 ounces of water per hour of exposure. It is truly an odd sensation to drink a gallon of water per day and not urinate at all - this massive amount of water is completely sweated out. With more than half of the days of July over 100F (it hit 101 while we were on this hike), Moab is a great and terrible place.

DSC_0119.JPG

In the middle of our second night there, we awoke to find ourselves being dragged away by the wind… while still in our tent. Though we tried desperately to weigh down what we figured were key areas, we had no chance to stay, so we scrambled out as quickly as we could and collapsed the tent. We were a little late in doing so as the wind had ripped a hole in the fabric, and bent one of the poles in half. Our camping was coming to a premature close. We slept in the car that night and decided that the next day we’d hike some of the easier trails and then head home.

I’ve got dozens of photos from the trip that are worth looking at (especially if you’ve never been). Later this summer I’d like to visit Dinosaur National Monument in western Colorado and/or Glacier National Park. Time permitting, of course.

Lightning

Last night we got a nice bit of lightning out here and so I thought I’d try to grab some shots. I got lucky and got a few, but I wish I had stayed out there longer. You can see the rest of the series and others on my new flicker account.

DSC_0012.JPG

Stanford Dragon and Gouraud Shading

I recently finished up school, and part of that was finishing up my ray tracing project. At the last minute, I implemented Gouraud shading which is a technique to try to smooth out a triangulated surface. What it really does is just linearly interpolate the normal vectors, where the normal of a vertex is calculated as a weighted average of the normals of the triangles using that vertex.

Long story short: [caption id=”attachment_542” align=”aligncenter” width=”300” caption=”A render of the Stanford bunny with my raytracer without Gouraud shading.”]A render of the Stanford bunny with my raytracer without Gouraud shading.[/caption]

[caption id=”attachment_543” align=”aligncenter” width=”300” caption=”A render of the Stanford bunny with smooth Gouraud shading.”]A render of the Stanford bunny with smooth Gouraud shading.[/caption]

Also, thanks to an improvement in my parallelization of the problem and a speedup in octtree traversal, I was able to render the Stanford dragon model (~1 million triangles):

[caption id=”attachment_544” align=”aligncenter” width=”300” caption=”The Stanford dragon model.”]The Stanford dragon model.[/caption]

Tomorrow!

[caption id=”attachment_538” align=”aligncenter” width=”300” caption=”Tomorrow!”]Tomorrow![/caption]

Stanford Bunny

The Stanford Bunny is a graphics benchmark of sorts. It was a high-resolution scan that the imaging lab there did of a ceramic bunny, and the triangulation is a popular model to test systems on.

It contains a little under 70,000 triangles which makes brute-force ray tracing intractable. I mentioned octtrees earlier, and so having built octtrees into my ray tracer, I was able to render the Stanford Bunny in about 40 minutes on one core. Granted, that’s with only 1-pass anti-aliasing, but I feel pretty good about this. I don’t think I’ll have a chance to implement Gouraud shading (or normal interpolation for that matter), but as soon as I do, it will look a lot less blocky.

[caption id=”attachment_535” align=”aligncenter” width=”300” caption=”The Stanford Bunny rendered with my ray tracer.”]The Stanford Bunny rendered with my ray tracer.[/caption]

Orbits

Orbiting planets. The days are about twice as along as they normally are relative to each planet’s year, but that’s an aesthetic preference. Enjoy.

Octtrees for Space Rasterization

Raytracing is slow. Incredibly slow. Painfully slow. That’s because you’ve got to check a lot of things to accurately determine what you’re seeing, if it’s in shadow, if it reflects off of something, etc., so it helps quite a bit to be able to get an idea beforehand of where everything is. Enter octtrees.

We’ve got a picture of a model (in this case, the Stanford bunny model). It consists of thousands of tiny triangles that make a surface. Then, imagine a cube surrounding the entire model. If there are two many triangles in that cube, you cut the cube in to eight smaller cubes, and repeat. What this build is a tree where “busy” portions of the space get divided more.

And now for pretty pictures: [caption id=”attachment526” align=”aligncenter” width=”300” caption=”The bunny on its own. There are tricks to smooth it out, but I left it highly triangulated to better represent the idea.”]The bunny on its own.  There are tricks to smooth it out, but I left it highly triangulated to better represent the idea.[/caption] [caption id=”attachment527” align=”aligncenter” width=”300” caption=”Bunny with balanced wireframe octtree around it.”]Bunny with balanced wireframe octtree around it.[/caption] [caption id=”attachment_528” align=”aligncenter” width=”300” caption=”Profile of the bunny with a very deep octtree.”]Profile of the bunny with a very deep octtree.[/caption]

I’m finishing up the implementation, and then I’ll be using it as part of my octtree as a intersection speedup.

Automated Web Resource Citing With Bibtex

I find myself constantly citing web resources that I need to cite, and I think it’s a huge hassle. They’ve all got the same format, and though Bibtex does a lot of the formatting heavy lifting for you, it’s still a pain.

Enter laziness.

From Safari, I drag a web location onto my desktop, or keep them in a references folder: [caption id=”attachment_514” align=”aligncenter” width=”300” caption=”Drag a link onto the desktop from Safari.”]Drag a link onto the desktop from Safari.[/caption]

And then drag the web location onto the droplet to get results. You can drag several files or folders on at once: [caption id=”attachment_515” align=”aligncenter” width=”300” caption=”Rejoice in the output.”]Rejoice in the output.[/caption]

[caption id=”attachment_516” align=”aligncenter” width=”300” caption=”Running on a directory.”]Running on a directory.[/caption]

Or from the command line tool (see the install tool): [caption id=”attachment_518” align=”aligncenter” width=”300” caption=”Using it from the command line.”]Using it from the command line.[/caption]

Installation: [caption id=”attachment_519” align=”aligncenter” width=”300” caption=”Disk image contents”]Disk image contents[/caption]

Files: webdoc-0.1