Another example here. Simple 2D bumpmap effect. There is just a problem with my environment map. I think it has to do with the accuracy of Number because the following returns NaN in most cases:
[as]
for ( var x: int = -0×80; x < 0x80; x++ )
{
for ( var y: int = -0x80; y < 0x80; y++ )
{
nx = x / 0x80;
ny = y / 0x80;
nz = max( 1 - sqrt(nx * nx + ny * ny) , 0 );
trace( nz );
}
}
[/as]




3 Responses to “Bumpmaps (AS3)”