Hey,
I used your very helpful project to create a Max OS version, which works great. I was just porting your project to WebGL, and while converting CNoiseDlg:FillGrad to JavaScript, I noticed that, even though Tempgrad3 is [32][3], there are only 24 rows of 3 gradient values:
bool CNoiseDlg::FillGrad(int nGradValue)
{
int Tempgrad3[32][3]=
{
{nGradValue,nGradValue,-nGradValue},
{nGradValue,-nGradValue,-nGradValue},
{-nGradValue,-nGradValue,nGradValue},
{-nGradValue,nGradValue,-nGradValue},
{nGradValue,-nGradValue,nGradValue},
{-nGradValue,nGradValue,-nGradValue},
{-nGradValue,nGradValue,nGradValue},
{-nGradValue,-nGradValue,nGradValue},
{nGradValue,-nGradValue,nGradValue},
{nGradValue,-nGradValue,nGradValue},
{nGradValue,nGradValue,-nGradValue},
{nGradValue,-nGradValue,nGradValue},
{-nGradValue,nGradValue,nGradValue},
{-nGradValue,nGradValue,nGradValue},
{-nGradValue,-nGradValue,nGradValue},
{-nGradValue,-nGradValue,nGradValue},
{nGradValue,-nGradValue,nGradValue},
{nGradValue,nGradValue,nGradValue},
{nGradValue,-nGradValue,nGradValue},
{nGradValue,-nGradValue,nGradValue},
{-nGradValue,nGradValue,nGradValue},
{-nGradValue,nGradValue,nGradValue},
{-nGradValue,nGradValue,-nGradValue},
{-nGradValue,nGradValue,-nGradValue}};
memcpy( m_nRandomValues, Tempgrad3, sizeof(Tempgrad3) );
return true;
}
In the debugger:
(gdb) p Tempgrad3
$1 = {{1, 1, -1}, {1, -1, -1}, {-1, -1, 1}, {-1, 1, -1}, {1, -1, 1}, {-1, 1, -1}, {-1, 1, 1}, {-1, -1, 1}, {1, -1, 1}, {1, -1, 1}, {1, 1, -1}, {1, -1, 1}, {-1, 1, 1}, {-1, 1, 1}, {-1, -1, 1}, {-1, -1, 1}, {1, -1, 1}, {1, 1, 1}, {1, -1, 1}, {1, -1, 1}, {-1, 1, 1}, {-1, 1, 1}, {-1, 1, -1}, {-1, 1, -1}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}
(gdb)
Was this intentional?
Thanks, and great work, BTW!
|