A picture is worth 1,000 lines of C++ code

A picture is worth 1,000 lines of C++ code
If a picture is worth a 1,000 words, then this beach ball graphic is worth a 1,000 lines of C++ code. The graphic is one created by computer science students at the University of California, San Diego who took CSE 168 and participated in the 2010 “paint pictures with C++ computer programming code” competition. Credit: UC San Diego / Bisker

If a picture is worth a 1,000 words, then the computer science corollary must be "a picture is worth a 1,000 lines of C++ code."

That's certainly the case for the computer science students at the University of California, San Diego who won the 2010 "paint pictures with C++ computer programming code" competition.

Computer science professor Henrik Wann Jensen - winner of a 2004 Academy Award for his work on realistic, computer-generated human skin - taught the class: CSE 168: Rendering Algorithms that finished with the friendly graphics competition.

For their final project, the Rendering Algorithms students pulled together what they'd learned about generating digital images from their own computer code and painted one final picture with C++.

Minutes before the final image presentations, which doubled as a friendly image competition, UC San Diego senior Nick Echols showed off a "behind the scenes" graphic tied to his CSE 168 final project. Meanwhile, competition judge and 2007 CSE 168 grand prize winner Iman Sadeghi searched for the key to the lecture hall.

Once the keys were located and the laptop projector fired up, the students presented final images revealing how hard-core programming - rather than off-the-shelf software like Photoshop and programs - can be used to generate aesthetically pleasing graphics.

In the grand prize winning image, flames dance within semi-transparent candle holders of different colors.

A smoky haze rises from each translucent candle holder. This candle light generates rings of light called caustics - which can occur when light passes from one medium to another, like from air to water. When sunlight passes through a magnifying lens, for example, the bright spot generated while focusing the lens on some surface is a caustic.

A picture is worth 1,000 lines of C++ code
For their final project, the Rendering Algorithms students from UC San Diego pulled together what they’d learned about generating digital images from their own computer code and painted one final picture with C++. In the grand prize winning image, flames dance within semi-transparent candle holders of different colors. Credit: UC San Diego / Dominguez-Caballero / Futrell

"In the case of our candle lights, the curvature and thickness of the crystal bottle makes light focus on the primary ring shown below the bottle. The secondary ring, which is bigger in diameter, is generated by the reflection of the smaller, brighter ring, against the bottle," explained Carlos Dominguez-Caballero, who together with fellow computer science master's student Holmes Futrell won the grand prize. CSE 168 is open to both advanced undergraduate students and graduate students.

The winning students also programmed the kitchen illumination, even though the actual light sources are not in the picture. This kitchen light bounces into the main room as indirect lighting. Note, the stream of light just to the left of the bunny pouring in from the kitchen.

"The grand prize image combined all the techniques that the students learned about in class and then added extras such as the glowing smoke above the candles - and they only had two weeks to accomplish this," said professor Henrik Wann Jensen.


Explore further

Computer graphics spills from milk to medicine

More information: See more images at: http://cse-ece-ucsd.blogspot.com/2010/06/cse168-rending-algorithms-first-second.html
Citation: A picture is worth 1,000 lines of C++ code (2010, July 3) retrieved 6 December 2021 from https://phys.org/news/2010-07-picture-worth-lines-code.html
This document is subject to copyright. Apart from any fair dealing for the purpose of private study or research, no part may be reproduced without the written permission. The content is provided for information purposes only.
0 shares

Feedback to editors