ware repair - fargo computer repair
Ware Repair closed August 28th, 2020

WebGL may be the BEST introduction to 3D programming - Part 1

WebGL may be the BEST introduction to 3D programming - Part 1

Written by Diane Diane Ware - January 14, 2019 in Programming

If you are a reader of some of my past blog posts, you will be aware that a while back I began a series of blogs for the explanation of the mathematics involved in implementing 3-dimensional (3D) programming. I still plan on doing this.

However, along the way in my search for understanding 3D programming, so as to understand more adequately the mathematics involved in 3D programming, I hit a few roadblocks. 

The main roadblocks I encountered were the books or tutorials used to teach the particular 3D programming language, and also the setup, i.e. files, IDEs, servers, etc., for the particular programming language. The books I found were available online, usually in PDF format. The tutorials were typically websites but also some YouTube videos. The books and tutorials themselves were usually good, and fairly easy to follow. But the books, because they were in most cases free versions, were typically older and a bit outdated in their material. The tutorials, whether at a website or a series of YouTube videos were usually current, but not always. But the main problems arose in the implementation. A lot of the book tutorials supplied files and integrated development environments (IDEs) downloads from the author's website or other websites. The files themselves were usually in good condition, but either the IDE itself would not install properly so as to even open the files, or the IDE would install but then require certain add-ons that were no longer obtainable or didn't work. For example, a particular C++ book tutorial required Microsoft's Visual Studio 2015 version. But upon installing Visual Studio 2015, certain C++ files would not open, requesting some other add-ons. I found the add-ons, installed them, but this still didn't fix the issue. So, I uninstalled the 2015 Visual Studio version and installed the 2017 version. But once again, this did not fix the issue. I could not open the files to continue the book's lessons. And this presented a huge problem, since the book's lessons required interacting with the C++ files to teach the fundamentals of 3D programming. 

Ugh, quite the dilemma. 

Now, keep in mind, that many CURRENT college-level 3D programming books (that can run about $30 to $50 on average) will most likely have both functional files and functional IDE download links. But I was attempting to accomplish my goal more on the library-esque/free route. 

After I encountered my dilemma, I did a bit more research and found WebGL. WebGL, and much of the needed support code to make it functional is ready and enabled by most modern web browsers, such as Google Chrome, Firefox, IE (Internet Explorer), and Edge. What this means is that if you write the JavaScript code for WebGL, and then run the code, via a .html file within the browser itself (or by means of web server, like WAMP), one of the aforementioned browsers will produce the 3D program, with no problem. 

At first, I was using a few online tutorials to learn WebGL. One of them was WebGL Fundamentals. I found this website tutorial to be rather hard to follow, since it jumped around a lot and didn't seem to give a solid foundation for WebGL on which to build further learning. I followed along with this tutorial for a while, but then felt it was too frustrating to continue with. I haven't gone back to this site. 

Next I found this tutorial, Mozilla's WebGL tutorial. At the start of this tutorial, the prospective 3D programmer is advised to learn HTML, CSS, but particularly JavaScript. This is very true. Not only should you have a basic to advanced level knowledge of HTML and CSS, but understanding JavaScript functions, objects, and the Document Object Model, DOM, is very important to comprehending WegGL coding. W3Schools is a good place to learn all these important web programming skills. After spending time at W3Schools learning more about JavaScript, since I already had sufficient knowledge of HTML and CSS, I dove into the Mozilla tutorial. And it went well, for quite some time, teaching the fundamental basics of WebGL, via 2D shape programming. But then, toward the end of the tutorial, I became quite disappointed. The tutorial simply ended, without even examining or producing any 3D programs. 

So, back to searching for a good WebGL tutorial. 

And then I found this website: WebGL Tutorial at TutorialsPoint. I browsed through the pages of this tutorial and it seemed to be quite good. But at the end of the tutorial, I found a list of WegGL books. And one of the recommended books, WebGL Beginner's Guide I decided to investigate. I was happy that I did. 

This book, WebGL Beginner's Guide was like a gold mine of 3D programming knowledge. 

In the next blog I write, I want to explain why WebGL Beginner's Guide has been one of the best sources for learning WebGL, and subsequently 3D programming, that I have encountered yet. 


Diane Ware

Manager - Tech Support

I am co-owner of Ware Repair and enjoy working with technology, web design and development, and embedded programming, especially that which applies to robotics. I also enjoy writing blogs and sci-fi novels on my free time.