// Resize the destination noise map so that it can store the new output
// values from the source model.
destNoiseMap.setSize (destWidth, destHeight);
// Create the cylinder model.
Cylinder cylinderModel = new Cylinder();
cylinderModel.setModule (sourceModule);
double angleExtent = upperAngleBound - lowerAngleBound ;
double heightExtent = upperHeightBound - lowerHeightBound;
double xDelta = angleExtent / (double)destWidth ;
double yDelta = heightExtent / (double)destHeight;
double curAngle = lowerAngleBound ;
double curHeight = lowerHeightBound;
// Fill every point in the noise map with the output values from the model.
for (int y = 0; y < destHeight; y++)
{
curAngle = lowerAngleBound;
for (int x = 0; x < destWidth; x++)
{
float curValue = (float)cylinderModel.getValue (curAngle, curHeight);
destNoiseMap.setValue(x, y, curValue);
curAngle += xDelta;
}
curHeight += yDelta;
setCallback (y);