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

Jul 03, 2010
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.

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: Avatars make the Internet sign to deaf people

More information: See more images at: http://cse-ece-ucsd.blogspot.com/2010/06/cse168-rending-algorithms-first-second.html

add to favorites email to friend print save as pdf

Related Stories

Computer graphics spills from milk to medicine

Aug 07, 2007

A new UC San Diego computer graphics model capable of generating realistic milk images based on the fat and protein content will likely push the field of computer graphics into the realms of diagnostic medicine, ...

New algorithm to improve video game quality

Feb 18, 2010

Research presented in a paper by Morgan McGuire, assistant professor of computer science at Williams College, and co-author Dr. David Luebke of NVIDIA, introduces a new algorithm to improve computer graphics for video games.

Alternative energy plan wins contest

May 08, 2006

An alternative energy company called Aurora BioFuels has won the $25,000 first prize at the eighth annual UC Berkeley Business Plan Competition at the University of California, Berkeley's Haas School of Business. Aurora BioFuels ...

Recommended for you

Avatars make the Internet sign to deaf people

Aug 29, 2014

It is challenging for deaf people to learn a sound-based language, since they are physically not able to hear those sounds. Hence, most of them struggle with written language as well as with text reading ...

Chameleon: Cloud computing for computer science

Aug 26, 2014

Cloud computing has changed the way we work, the way we communicate online, even the way we relax at night with a movie. But even as "the cloud" starts to cross over into popular parlance, the full potential ...

User comments : 11

Adjust slider to filter visible comments by rank

Display comments: newest first

DigiMc
1 / 5 (1) Jul 03, 2010
Photoshop and 3d graphics programs are hard-core programming as well.
Jigga
5 / 5 (3) Jul 03, 2010
Actually this ball is rendered on background of real photo:

http://tinyurl.com/344pe28
frajo
1 / 5 (5) Jul 03, 2010
Actually this ball is rendered on background of real photo
How would you know?
Don_Palathara
5 / 5 (1) Jul 03, 2010
Actually this ball is rendered on background of real photo:

http://tinyurl.com/344pe28
True. Look at the picture. Using c++ for creating animations also needs good programming skills.
jamey
5 / 5 (2) Jul 03, 2010
I have to wonder about how those lines of code are counted. How much gets dragged in by #includes and other library stuff - after all, this *is* C++ we're talking about. Gimme Kbytes of compiled code to know how big the program is.
Jigga
not rated yet Jul 03, 2010
Here is the legendary 64kb demo which won the Party 2k (actually is much smaller, then the HTML code of this web page, not saying about embedded graphics)

http://www.theproduct.de
frajo
1 / 5 (3) Jul 03, 2010
Actually this ball is rendered on background of real photo:
...
True. Look at the picture.
By looking at a picture you can discover whether it's a real photo or not?
Recovering_Human
3 / 5 (2) Jul 03, 2010
Actually this ball is rendered on background of real photo:
...
True. Look at the picture.
By looking at a picture you can discover whether it's a real photo or not?


Certainly so in this case. Actually, the picture is both real and fake, and it's really easy to see which parts are which.
frajo
1 / 5 (2) Jul 04, 2010
Actually this ball is rendered on background of real photo:
...
True. Look at the picture.
By looking at a picture you can discover whether it's a real photo or not?


Certainly so in this case. Actually, the picture is both real and fake, and it's really easy to see which parts are which.
I don't trust any picture.
Jimbaloid
5 / 5 (1) Jul 06, 2010
Actually this ball is rendered on background of real photo
How would you know?


The sudden linear transition in the sand behind, and the square mismatched shadowing effect to the left of the ball. Mismatch in the direction and diffusion of the light. Experience.
frajo
5 / 5 (1) Jul 06, 2010
Actually this ball is rendered on background of real photo
How would you know?


The sudden linear transition in the sand behind, and the square mismatched shadowing effect to the left of the ball. Mismatch in the direction and diffusion of the light. Experience.
Thanks for explaining.

As a sidenote, the reactions of Hunnter, Noumenon, and EarthlingX to two objective questions and one subjective, non-aggressive statement are a bit interesting. Not, however, the reactions of ubavontuba and otto1923. They are predictable.