cleaning and editing

pull/14/head
Patricio Gonzalez Vivo 9 years ago
parent 4a4e9c0185
commit e148b07be7

@ -164,7 +164,7 @@ In terms of computational power the [```sqrt()```](../glossary/index.html#sqrt.m
![Zen garden](zen-garden.jpg) ![Zen garden](zen-garden.jpg)
Distance fields can be used to draw almost everything. Obviously the more complex a shape is, the more complicated its equation will be, but once you have the formula to make distance fields of a particular shape it is very easy to combine and/or apply effects to it, like smooth edges and multiple outlines. Because of this, distance fields are popular in font rendering, like [Mapbox GL Labels](https://www.mapbox.com/blog/text-signed-distance-fields/) and [Matt DesLauriers](https://twitter.com/mattdesl) [Material Design Fonts](http://mattdesl.svbtle.com/material-design-on-the-gpu). Distance fields can be used to draw almost everything. Obviously the more complex a shape is, the more complicated its equation will be, but once you have the formula to make distance fields of a particular shape it is very easy to combine and/or apply effects to it, like smooth edges and multiple outlines. Because of this, distance fields are popular in font rendering, like [Mapbox GL Labels](https://www.mapbox.com/blog/text-signed-distance-fields/), [Matt DesLauriers](https://twitter.com/mattdesl) [Material Design Fonts](http://mattdesl.svbtle.com/material-design-on-the-gpu) and [as is describe on Chapter 7 of iPhone 3D Programming, OReilly](http://chimera.labs.oreilly.com/books/1234000001814/ch07.html#ch07_id36000921).
Take a look at the following code. Take a look at the following code.

@ -11,15 +11,15 @@ mat2 dMat2 = mat2(aVec3, aFloat);
``` ```
### Description ### Description
The data type ```mat2``` is used for floating point matrices with two times two components in column major order. There are several ways to initialize a matrix: ```mat2``` data type is compose for a 2x2 matrix of floating point. As you can see above, can be initialize in different ways:
- Components are specified by providing a scalar value for each component (first example). The matrix is filled column by column. - Providing a value for each component column by column.
- Components are specified by providing one scalar value. This value is used for the components on the main diagonal (the second example is equivalent to the first). - Providing one value that is used for the components on the main diagonal.
- Components are specified by providing a combination of vectors and scalars. The respective values are used to initialize the components column by column. The arguments of the constructor must have at least as many components as the matrix that is initialized. - Providing a combination of vectors and scalars.
The following examples show how the values of a matrix can be accessed to set or get the values: In the same way data can be accessed component-wise or column by column:
```glsl ```glsl
mat2 aMat2; mat2 aMat2;
@ -30,15 +30,5 @@ aMat2[0] = vec2(1.0);
vec2 aVec2 = aMat2[0]; vec2 aVec2 = aMat2[0];
``` ```
The values of a matrix can be accessed component-wise or column by column:
- In the first example the bottom right component of a matrix is set to a float value.
- In the second example a new variable of type float is initialized with the value of the bottom right component of a matrix.
- In the third example the first column vector of a matrix is set with a vector.
- In the fourth example a new variable of type float vector is initialized with the column vector.
### See Also ### See Also
[mat3](index.html#mat3.md), [mat4](index.html#mat4.md), [matrixCompMult()](index.html#matrixCompMult.md) [mat3](index.html#mat3.md), [mat4](index.html#mat4.md), [matrixCompMult()](index.html#matrixCompMult.md)

@ -13,15 +13,16 @@ mat3 dMat3 = mat3(aVec4, aVec3, bVec4, aFloat);
``` ```
### Description ### Description
The data type ```mat3``` is used for floating point matrices with three times three components in column major order. There are several ways to initialize a matrix: ```mat3``` data type is compose for a 3x3 matrix of floating point. As you can see above, can be initialize in different ways:
- Components are specified by providing a scalar value for each component (first example). The matrix is filled column by column. - Providing a value for each component column by column.
- Components are specified by providing one scalar value. This value is used for the components on the main diagonal (the second example is equivalent to the first). - Providing one value that is used for the components on the main diagonal.
- Components are specified by providing a combination of vectors and scalars. The respective values are used to initialize the components column by column. The arguments of the constructor must have at least as many components as the matrix that is initialized. - Providing a combination of vectors and scalars.
In the same way data can be accessed component-wise or column by column:
The following examples show how the values of a matrix can be accessed to set or get the values:
```glsl ```glsl
mat3 aMat3; mat3 aMat3;
@ -32,15 +33,5 @@ aMat3[0] = vec3(1.0);
vec3 aVec3 = aMat3[0]; vec3 aVec3 = aMat3[0];
``` ```
The values of a matrix can be accessed component-wise or column by column:
- In the first example the bottom right component of a matrix is set to a float value.
- In the second example a new variable of type float is initialized with the value of the bottom right component of a matrix.
- In the third example the first column vector of a matrix is set with a vector.
- In the fourth example a new variable of type float vector is initialized with the column vector.
### See Also ### See Also
[mat2](index.html#mat2.md), [mat4](index.html#mat4.md), [matrixCompMult()](index.html#matrixCompMult.md) [mat2](index.html#mat2.md), [mat4](index.html#mat4.md), [matrixCompMult()](index.html#matrixCompMult.md)

@ -14,15 +14,15 @@ mat4 dMat4 = mat4(aVec4, aVec3, bVec4, cVec4, aFloat);
``` ```
### Description ### Description
The data type mat4 is used for floating point matrices with four times four components in column major order. There are several ways to initialize a matrix: ```mat4``` data type is compose for a 4x4 matrix of floating point. As you can see above, can be initialize in different ways:
- Components are specified by providing a scalar value for each component (first example). The matrix is filled column by column. - Providing a value for each component column by column.
- Components are specified by providing one scalar value. This value is used for the components on the main diagonal (the second example is equivalent to the first). - Providing one value that is used for the components on the main diagonal.
- Components are specified by providing a combination of vectors and scalars. The respective values are used to initialize the components column by column. The arguments of the constructor must have at least as many components as the matrix that is initialized. - Providing a combination of vectors and scalars.
The following examples show how the values of a matrix can be accessed to set or get the values: In the same way data can be accessed component-wise or column by column:
```glsl ```glsl
aMat4[3][3] = 1.0; aMat4[3][3] = 1.0;
@ -32,15 +32,5 @@ aMat4[0] = vec4(1.0);
vec4 aVec4 = aMat4[0]; vec4 aVec4 = aMat4[0];
``` ```
The values of a matrix can be accessed component-wise or column by column:
- In the first example the bottom right component of a matrix is set to a float value.
- In the second example a new variable of type float is initialized with the value of the bottom right component of a matrix.
- In the third example the first column vector of a matrix is set with a vector.
- In the fourth example a new variable of type float vector is initialized with the column vector.
### See Also ### See Also
[mat2](index.html#mat2.md), [mat3](index.html#mat3.md), [matrixCompMult()](index.html#matrixCompMult.md) [mat2](index.html#mat2.md), [mat3](index.html#mat3.md), [matrixCompMult()](index.html#matrixCompMult.md)
Loading…
Cancel
Save