mirror of
https://github.com/patriciogonzalezvivo/thebookofshaders
synced 2024-11-08 01:10:27 +00:00
20 lines
411 B
Markdown
20 lines
411 B
Markdown
|
## Normalize
|
||
|
Calculate the normalize product of two vectors
|
||
|
|
||
|
### Declaration
|
||
|
```glsl
|
||
|
float normalize(float x)
|
||
|
vec2 normalize(vec2 x)
|
||
|
vec3 normalize(vec3 x)
|
||
|
vec4 normalize(vec4 x)
|
||
|
```
|
||
|
|
||
|
### Parameters
|
||
|
```v``` specifies the vector to normalize.
|
||
|
|
||
|
### Description
|
||
|
```normalize()``` returns a vector with the same direction as its parameter, v, but with length 1.
|
||
|
|
||
|
### See Also
|
||
|
|
||
|
[length()](index.html#length.md)
|