Bumpmaps (AS3)

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 Trackbacks

  1. [...] (example) AS3 oldschool fire (source + example) AS3 oldschool tunnel (source + example) AS3 Bumbmaps (source + example) How to use Sockets in Actionscript3? (source) Lightning particlesAn [...]

  2. By 红烧带鱼 on Jan 10, 2006 at 6:04 pm

    ActionScript 3.0 站点集合

    转自(http://bbs.javascript.com.cn/read.p…=1604&fpage=1)ActionScript 3.0 collection 68 sitesActionScript…

  3. [...] AS3 Bumbmaps (mapa de profundidad) [...]

Post a Comment

Your email is never shared. Required fields are marked *

*
*