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

Selecting irregular shapes from a textured 3D mesh


3D for education has unlimited possibilities because it adapts so well to demonstrations and presentations. For instance, we can click on organs of the body to teach Biology. But, as we have seen previously, this can be tedious to model. We may be better off applying a texture map and then clicking on individual components. Unfortunately, none of these components, such as the organs of the body fit into nice easy boxes like our periodic table of elements. Instead, we need to select individual pixels on the texture map, and have a system that identifies a particular pixel with the component. Clicking on a pixel within the image of the heart identifies the object that was clicked on as the heart. That alone requires some special programming. But, there is another issue, texture map perspective correction, that up until now was handled by the graphics card when we send the vertices and texture map to the fragment shader. However, we must now...