Un generador de texturas con JavaScript y Canvas-texgen. js
| Autor: | mrdoob |
|---|---|
| Views Total: | 2,359 |
| Sitio oficial: | Ir a la web |
| Actualizado: | February 28, 2016 |
| Licencia: | MIT |
Vista prévia
Descripción
texgen. js es una biblioteca de JavaScript pura que se utiliza para dibujar texturas estáticas o animadas usando HTML5 Canvas 2D Drawing API.
¿Cómo funciona?
Cargue el texgen. js en el documento.
<script src="src/TexGen.js"></script>
El ejemplo de JavaScript.
var texture = new TG.Texture( 256, 256 ) .add( new TG.XOR() ) .mul( new TG.OR().color( 0.5, 0.8, 0.5 ) ) .mul( new TG.SinX().frequency( 0.0312 ) ) .div( new TG.SinY().frequency( 0.0312 ) ) .add( new TG.SinX().frequency( 0.004 ).color( 0.5, 0, 0 ) ) .add( new TG.Noise().color( 0.1, 0.1, 0.2 ) ) .toCanvas(); document.body.appendChild( texture );
Registro de cambios
02/28/2016
- Bugfix





