How to implement a simple cube in WebGL without using any libraries as glMatrix, etc.?

I studied three.js and this library is awesome, it simplifies my development process. But today I want to start learning simple WebGL just for a better understanding, and I want to implement basic samples from scratch without using an already made JavaScript library such as glMatrix, sylvester, j3di, etc.

I tried to find some simple examples on the Internet, but any example that is close to simple (I mean "without using any additional libraries" in this context) uses some libraries.

Of course, using the library is very good when you are developing a product to save your time, but my goal is different today, I just want to understand how to make planes, cubes and others in WebGL from scratch, just for understanding.

I ask for such samples, because even in the official wiki MDN or Khronos there are suggestions for using libraries:

So, can you help me show a WebGL sample with a cube or plane that doesn't use the library.

+4

Source: https://habr.com/ru/post/1539166/


All Articles