Package libnoiseforjava.model

Examples of libnoiseforjava.model.Cylinder


      // 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);
View Full Code Here

TOP

Related Classes of libnoiseforjava.model.Cylinder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.