[WebGL Primer] 10, matrix calculations and external libraries

Source: Internet
Author: User

Note: The article is translated from http://wgld.org/, the original author Sambonja 広 (doxas), the article assumes that I have additional instructions, I will add [Lufy:], in addition, My own WEBGL research is not deep enough, some professional words, assuming that the translation is wrong, welcome to correct them.


Important Usage

The computational method of matrices is not a particularly strange and complicated thing, assuming that mathematics is well studied, there is no basis for the main matrix calculations. However, assuming that the addition and multiplication of matrices are not known, it is very difficult to perform a slightly more complex matrix calculation.
DirectX or OpenGL, in fact, if you can not master the use of the matrix, programming will become very difficult. However, it does not mean that every corner of the matrix must be mastered.
It is important that the use of matrices is not a concrete method of calculation. Especially in the 3D development, what the matrix can do, and what the operation can get the result, mainly mastering the use of the matrix, this is very important.
Suppose to some extent understand the use of the matrix, in the actual development encountered what problems, you can know how to find the reason. Then, it can be further improved. So, not all of a sudden all understand, first grasp the matrix processing process and use can be.


proficiency with external libraries

In DirectX and OpenGL, many matrix-related processing is built in, and matrix calculations are possible even without using an external library.
However, in WebGL, these matrix-related calculations are not, perhaps to simplify it, of course, not to say there is no way, but the matrix-related calculations, all need to deal with their own.
That being said, the matrix calculation in WebGL is still a very big problem. A good man of course is no problem, but it is too difficult for other people who are not so good at learning.
But, don't be afraid, there are very many external libraries that use JavaScript to write the matrix calculation, using these external libraries, even if they do not matrix computing, but also to do matrix-related processing, the following are some of them.

Glmatrix

http://code.google.com/p/glmatrix/

MJs

http://code.google.com/p/webgl-mjs/

Sylvester

http://sylvester.jcoglan.com/

Closure

http://code.google.com/p/closure-library/

TDL

http://code.google.com/p/threedlibrary/

When using the external library of the matrix calculation, only need to grasp the use of these libraries, you can do matrix calculation, but to master the use of these libraries may also be a very easy thing to do.
In this site, the use of their own development of the Minmatrix.js library, this JS file, only the basic calculation of the matrix, not particularly intact, so we can completely free to use, commercial can, there is no special restrictions.
Later, the code and cases in this site are used to explain the premise of this minmatrix.js library. The connection to this library is given at the very top of this article, and you are free to download and use it.
In addition, the calculation of the matrix in this minmatrix.js file, which references other Web pages and Glmatrix content, is very much appreciated by the authors of the pages and the author of Glmatrix Brandon Jones (Brandon Jones's blog, Tojicode)


Summary

In the long run, the knowledge of matrices is still not lacking when it comes to really complex processing. However, it is very difficult to understand these in advance. Therefore, the first skilled use of external libraries, and so can be proficient in 3D development, and then gradually understand this knowledge is relatively ideal.
When using external libraries, there may also be platform problems that must be used to understand the features of the external library, not to say that there is no problem at all. The library used in this site is the manager (Lufy: Here the manager is the author himself ) of their own library, will minimize the use of the threshold.


The next time you start, use Minmatrix.js to represent a polygon. Additional minmatrix.js download connections such as the following.

wgld.org Development of Matrix Computing Library Minmatrix.js

Http://wgld.org/j/minMatrix.js


reprint Please specify: transfer from Lufy_legend's blog Http://blog.csdn.net/lufy_legend

[WebGL Primer] 10, matrix calculations and external libraries

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.