Posts tagged with 'raytracing'

PCPlus 295: Raytracing revealed

This article followed on from the previous, as it happened. You see I’d painstakingly drawn the figures for the pentominoes article in Adobe Illustrator and I got to wondering if there was an easier way to create them. I half-remembered about ray-tracing (my friend Duncan had created some great images a while back) and so I looked it up. A couple of links later I had POV-Ray downloaded and installed and was playing around. Naturally, the ray-traced image I spent most time on for this article was an image showing a pentomino solution. I even wrote about it on this blog at the time.

Raytraced pentomino solution

Not much else to report about this article. I did some research on how it all worked (lots of mathematics!) and essentially presented that from a layman’s viewpoint. Basically you view the image as a viewport onto a scene. For each pixel in the viewport you trace back the ray of light that produced the pixel value, taking into account reflections from and refractions through the objects in the scene. Lots of computation later, and you have a very photo-realistic image.

In reality, playing with POV-Ray is a hoot. You tweak here and there, defining your objects, their color and transparency, and let it rip generating the image. Rinse and repeat.

PC Plus logoThis article first appeared in issue 295, June 2010.

You can read the PDF here.

(I write a monthly column for PCPlus, a computer news-views-n-reviews magazine in the UK (actually there are 13 issues a year — there's an Xmas issue as well — so it's a bit more than monthly). The column is called Theory Workshop and appears in the Make It section of the magazine. When I signed up, my editor and the magazine were gracious enough to allow me to reprint the articles here after say a year or so.)

Album cover for Shaking the Tree: Sixteen Golden GreatsNow playing:
Gabriel, Peter - Family Snapshot
(from Shaking the Tree: Sixteen Golden Greats)


Ray tracing image from June 2010’s PCPlus

I’ve just sent off June 2010’s article for PCPlus to my editor, just a smidgeon late. A couple of days is all. It’s on ray tracing, something I’ve wanted to discuss and play around with for a while. I downloaded POV-Ray, an open-source ray tracing renderer for Windows, OSX, and Linux to use as a test-bench, and spent some fun hours with it.

PCPlus logoFor the article I had to create an original image. Well, not ‘had to’ exactly, but I thought it only right that I show something that didn’t come from wikipedia or some other ray tracing enthusiast’s site. I certainly didn’t want to show the standard reflective ball hovering over a checkerboard image, although I admit snagging the sphere code from Christoph Hormann’s site. I decided to go for an image showing a 6×10 pentomino solution, since the previous article was about pentominoes and how to solve geometric puzzles with them.

Here’s the final image, after I’d spent entirely too much time this morning messing around with various options instead of completing the ruddy article.

Raytraced pentomino solution

(Click to make larger.) In essence I wanted to show off most of the topics I discussed in the article in one image. The pentominoes are translucent, so the shadow is colored. There are two light sources, a main white one and a slightly reddish-tinged dim one. The spheres reflect each other, the solution, and the shadows.

If you’ve downloaded POV-Ray and want to generate this image yourself, here’s the code. If you want to read the article, buy PCPlus’ June issue when it hits the newsstands, or wait until June 2011 when I’ll publish it here on this blog.

Album cover for Shepherd MoonsNow playing:
Enya - Marble Halls
(from Shepherd Moons)



Search

About Me

I'm Julian M Bucknall, the M because it's my middle initial and because I and the other Julian Bucknall (the movie guy) would like to differentiate ourselves.

I'm a programmer by trade, an actor by ambition, and an algorithms guy by osmosis. I write articles for PCPlus in my spare time, not that there's much of that.

Julian M Bucknall Apart from that, an ex-pat Brit, atheist, microbrew enthusiast, Pet Shop Boys fanboy, slide rule and HP calculator collector, amateur photographer, Altoids muncher.

DevExpress

I'm Chief Technology Officer at Developer Express, a software company that writes some great controls and tools for .NET and Delphi. I'm responsible for the technology oversight and vision of the company.

Validation

Validate markup as HTML5 (beta)     Validate CSS

Bottom swirl

Archives

February 2012 (3)
SMTWTFS
« Jan  
1234
567891011
12131415161718
19202122232425
26272829

Like this Archive Calendar widget? Download it here.

Social networking

Google ads

The OUT Campaign

The OUT Campaign

My Tweets

  • @TerriMorton "The Texan-ized Eiffel Tower" <shudders, whimpers in corner> /cc @rachelreese
  • One of my blog readers found this awesome picture of Roger Moore modeling a pullover in a "Father and Son" pattern http://t.co/DRs4dLSu
  • @RachelHawley First Vaseline, then a drill. It's a good job I have no imagination.
Bottom swirl