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

Comparing multiple stocks in 3D


After parsing and displaying the data from a single stock, we will now display the data from multiple stocks in a single scene. The level of programming jumps significantly when we grow from showing just a single stock value to showing two or more. We shall do this now by showing data from five stocks.

Engage thrusters

Not surprisingly, growing from displaying one stock to five stocks means that we have to deploy an array constructed with the global variable var stockBoxObject = [];. We will build the boxes that will represent our stock data inside webGLStart():

stockBoxObject[0] = AddMeshObject("texturedBox0", "texturedBox.obj",[-5.5, -3.0, -16.0], [1, 1, 1], [0, 0, 0], false );
 ……
stockBoxObject[4] = AddMeshObject("texturedBox4", "texturedBox.obj",[5.5, -3.0, -16.0], [1, 1, 1], [0, 0, 0], false );

The boxes are numbered 0 to 4, but only the first box (number 0) and the last box (number 4) are shown in the code, with boxes 1, 2, and 3 having similar code. There...

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