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", ...
Get WebGL HOTSHOT now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.