Book Image

WebGL HOTSHOT

By : Mitch Williams
Book Image

WebGL HOTSHOT

By: Mitch Williams

Overview of this book

Table of Contents (17 chapters)
WebGL HOTSHOT
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Loading a 3D modeled object, normals, and lighting


Ultimately, we want to display 3D objects that look like regular characters and objects. Generally, these are 3D meshes designed by professional artists in 3D modeling programs such as 3D Studio Max, Maya, and Blender. There is no single standard file format, but the .obj format is a common file format to export from those 3D modeling tools. Barring some exceptions, we only want to export triangles—for the 3D artist, this is just a checkbox on the file/export user interface of 3D modeling programs. For the programmer, however, to accept polygons other than three-vertex triangles requires a lot of programming. There are other issues too with exporting polygons with four or more vertices from a 3D modeling program, as all the vertices must be located on a flat plane. The polygon can be angled, but it has to stay on a planar surface. Another way to think of this is that a three-legged table will not wobble, but a table with four legs may have...