Reader small image

You're reading from  WebGL HOTSHOT

Product typeBook
Published inMay 2014
Publisher
ISBN-139781783280919
Edition1st Edition
Concepts
Right arrow
Author (1)
Mitch Williams
Mitch Williams
author image
Mitch Williams

Mitch Williams has been involved with 3D graphics programming and Web3D development since its creation in the mid 1990s. He began his career writing software for digital imaging products before moving on as Manager of Software for Vivendi Universal Games. In the late 1990s, he started 3D-Online, his own company, where he created "Dynamic-3D", a Web3D graphics engine. He has worked on various projects ranging from interactive 3D medical procedures, online 3D training for the Department of Defense, creating one of the first 3D mobile games prior to the launch of the iPhone, and graphics card shader language programming. He has been teaching Interactive 3D Media at various universities including UC Berkeley, UC Irvine, and UCLA Extension.
Read more about Mitch Williams

Right arrow

Lighting 3D depths


You can think of 3D as the objects in a scene, but there are also unseen objects such as the lights and camera. This next web advertisement animates a camera while deploying two different light sources: neon lights and spotlights. To add a little character, the spotlights flicker and the neon sign turns on in a sequence.

Engage thrusters

The advertisement begins with the camera animation and the lights randomly turning on in order to catch the viewers' attention. This also emphasizes the features of 3D that cannot be emulated in a 2D animation without a heavy download. The camera points to a fixed target while slowly animating from the left of the 3D scene towards the center by changing the camera's eye value. This is shown in the following screenshot:

We begin by defining the start and end positions for the camera:

var eyeStart = [ -10, 5, -2, 1 ];
var eyeEnd   = [ -6, 3, 6, 1 ];
var eye    = [ eyeStart[0], eyeStart[1], eyeStart[2], 1 ];

Within the drawScene() function, the...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
WebGL HOTSHOT
Published in: May 2014Publisher: ISBN-13: 9781783280919

Author (1)

author image
Mitch Williams

Mitch Williams has been involved with 3D graphics programming and Web3D development since its creation in the mid 1990s. He began his career writing software for digital imaging products before moving on as Manager of Software for Vivendi Universal Games. In the late 1990s, he started 3D-Online, his own company, where he created "Dynamic-3D", a Web3D graphics engine. He has worked on various projects ranging from interactive 3D medical procedures, online 3D training for the Department of Defense, creating one of the first 3D mobile games prior to the launch of the iPhone, and graphics card shader language programming. He has been teaching Interactive 3D Media at various universities including UC Berkeley, UC Irvine, and UCLA Extension.
Read more about Mitch Williams