/** * Creates a frustum like prism with elliptical base rather than circular. * The major axis is equivalent to the radius specified and the minor axis * is computed from the eccentricity. * * @param sides Integer number of sides to the prism. * @param radiusTop Double the radius of the top. * @param radiusBase Double the radius of the base. * @param eccentricity Double the eccentricity of the ellipse. * @param height Double the height of the prism. * @param createVBOs Boolean If true, the VBOs are created immediately. */ public NPrism(int sides, double radiusTop, double radiusBase, double eccentricity, double height, boolean createVBOs) { if (sides < 3) throw new IllegalArgumentException("Prisms must have at least 3 sides!"); if ((eccentricity < 0) || (eccentricity >= 1)) throw new IllegalArgumentException("Eccentricity must be in the range [0,1)"); mSideCount = sides; mEccentricity = eccentricity; mRadiusTop = radiusTop; mMinorTop = calculateMinorAxis(mRadiusTop); mRadiusBase = radiusBase; mMinorBase = calculateMinorAxis(mRadiusBase); mHeight = height; init(createVBOs); }
/** * Creates a frustum like prism with elliptical base rather than circular. * The major axis is equivalent to the radius specified and the minor axis * is computed from the eccentricity. * * @param sides Integer number of sides to the prism. * @param radiusTop Double the radius of the top. * @param radiusBase Double the radius of the base. * @param eccentricity Double the eccentricity of the ellipse. * @param height Double the height of the prism. * @param createVBOs Boolean If true, the VBOs are created immediately. */ public NPrism(int sides, double radiusTop, double radiusBase, double eccentricity, double height, boolean createVBOs) { if (sides < 3) throw new IllegalArgumentException("Prisms must have at least 3 sides!"); if ((eccentricity < 0) || (eccentricity >= 1)) throw new IllegalArgumentException("Eccentricity must be in the range [0,1)"); mSideCount = sides; mEccentricity = eccentricity; mRadiusTop = radiusTop; mMinorTop = calculateMinorAxis(mRadiusTop); mRadiusBase = radiusBase; mMinorBase = calculateMinorAxis(mRadiusBase); mHeight = height; init(createVBOs); }