Real-Time 3D Graphics with WebGL 2
Second Edition
Build interactive 3D applications with JavaScript and WebGL 2 (OpenGL ES 3.0)
Farhad Ghayour
Diego Cantor
BIRMINGHAM - MUMBAI
Real-Time 3D Graphics with WebGL 2Second Edition
Copyright 2018 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Commissioning Editor: Kunal Chaudhari
Acquisition Editor: Divya Poojari
Content Development Editor: Francis Carneiro
Technical Editor: Sachin Sunilkumar
Copy Editor: Safis Editing
Project Coordinator: Sheejal Shah
Proofreader: Safis Editing
Indexer: Aishwarya Gangawane
Graphics: Jason Monteiro
Production Coordinator: Shraddha Falebhai
First published: June 2012
Second edition: October 2018
Production reference: 1311018
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78862-969-0
www.packtpub.com
To God, for His many blessings, and to my caring family, friends, and colleagues, who have always been there for me.
Farhad Ghayour
To my family: Luis, Cecy, Jonathan, and Fredy.
Diego Cantor
mapt.io
Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Why Subscribe?
Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
Get a free eBook or video every month
Mapt is fully searchable
Copy and paste, print, and bookmark content
Packt.com
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.packt.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at customercare@packtpub.com for more details.
At www.packt.com , you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
Foreword
Having worked with Farhad Ghayour for over 10 years, I can assure you that he prioritizes practicality and innovation above all. With years of experiences in building businesses from the ground up, Farhad will help you filter what is useful from what is unnecessary in guiding you towards success.
WebGL is a technology that will change the way we interact with our digital devices. As a UI/UX thought leader, Farhad will walk you through a systematic process for how to deliver and optimize compelling user experiences with WebGL. This book will show you what can be done with practical examples and what we can look forward to in the near future.
Jonathan Melo
Lead Engineer and Serial Entrepreneur
Contributors
About the Authors
Farhad Ghayour is a technology consultant based out of San Francisco, California, where he helps transform Fortune 500 companies worldwide.
Currently, he is focused on technology solutions at the intersection of computer graphics, vision, and machine learning. Previously, he was a core contributor to a leading open source WebGL engine, lead engineer at various start-ups around the world, a philosophy teacher, a serial entrepreneur, and an investment banker.
He is passionate about all things philosophy, math, code, and design. When he is not working, you can either find him racing cars or trying out new Chinese hotpot restaurantsmost likely, hotpot.
Id like to thank my colleagues at Famo.us, who ignited my enduring passion for graphics; my philosophy professors, who provided me with tools and rigor; my collaborators, Diego and Brandon, for offering me a solid foundation; my close friends for continually helping me grow; and the Packt editorial, especially Francis Savio Carneiro, for their patience and continual support.
Most importantly, Id like to express my deepest appreciation and special gratitude to my loving and supporting family.
About the Authors
Diego Cantor received his M.Eng. in Systems and Computer Engineering from Universidad de Los Andes (Colombia), and his Ph.D. in Biomedical Engineering from Western University (Canada). He published the first-ever online beating heart and brain cortex map using WebGL. He is also the author of the WebGL Beginner's Guide which sold internationally in English, Korean and Chinese. Diego is passionate about open source and web technologies, and he has worked extensively in medical imaging technologies. In his free time, he enjoys working out, classical music and learning new languages.
I wish to express my most sincere gratitude and appreciation to Farhad Ghayour for his commitment to this project. Farhad's enthusiasm and knowledge about WebGL are both abundant and compelling. Without him, this book would not have been a reality. Farhad: I look forward to future collaborations! Also, I would like to recognize the amazing work of the technical reviewers and the Packt editorial team and, in particular, to Divya Poojari for her infinite patience and willingness to collaborate across oceans, and time zones.
About the Reviewers
Sebastian Hack is an R&D software engineer who specializes in computer vision, machine learning, and robotics. After graduating from the University of California, Berkeley, with a bachelor's degree in Electrical Engineering and Computer Science, he moved to work on Microsoft's HoloLens. Outside of work, he enjoys playing tennis, watching classic films, and racing quadcopter drones.
I would like to acknowledge Maggie Miller-Hack for supporting my interest in engineering, and Farhad Ghayour for spearheading this project.
Next page