Package renderer.models_L
Class PyramidFrustum
- java.lang.Object
-
- renderer.scene.Model
-
- renderer.models_L.PyramidFrustum
-
- All Implemented Interfaces:
MeshMaker
public class PyramidFrustum extends Model implements MeshMaker
Create a wireframe model of a frustum of a right square pyramid with its base in the xz-plane.- See Also:
Pyramid
-
-
Constructor Summary
Constructors Constructor Description PyramidFrustum()Create a frustum of a right square pyramid with its base in the xz-plane, a base side length of 2, top side length of 1, and height 1/2.PyramidFrustum(double s1, double s2, double h)Create a frustum of a right square pyramid with its base in the xz-plane, a base side length ofs1, top side length ofs2, and heighth.PyramidFrustum(double s1, double s2, double h, int n, int k)Create a frustum of a right square pyramid with its base in the xz-plane, a base side length ofs1, top side length ofs2, and heighth.PyramidFrustum(int n, int k, double s, double h, double a)Create a frustum of a right square pyramid with its base in the xz-plane, a base side length ofs, top of the frustum at heighth, and with the pyramid's apex at on the y-axis at heighta.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetHorzCount()intgetVertCount()PyramidFrustumremake(int n, int k)Build an instance of theModelwith new values for the number of lines of latitude and longitude while keeping all the other model parameters the same.-
Methods inherited from class renderer.scene.Model
addColor, addPrimitive, addVertex, getPrimitive, toString
-
-
-
-
Constructor Detail
-
PyramidFrustum
public PyramidFrustum()
Create a frustum of a right square pyramid with its base in the xz-plane, a base side length of 2, top side length of 1, and height 1/2.
-
PyramidFrustum
public PyramidFrustum(double s1, double s2, double h)
Create a frustum of a right square pyramid with its base in the xz-plane, a base side length ofs1, top side length ofs2, and heighth.This model works with either
s1 > s2ors1 < s2. In other words, the frustum can have its "apex" either above or below the xz-plane.- Parameters:
s1- side length of the base of the frustums2- side length of the top of the frustumh- height of the frustum
-
PyramidFrustum
public PyramidFrustum(int n, int k, double s, double h, double a)
Create a frustum of a right square pyramid with its base in the xz-plane, a base side length ofs, top of the frustum at heighth, and with the pyramid's apex at on the y-axis at heighta.- Parameters:
n- number of lines of latitudek- number of lines of longitudes- side length of the base of the frustumh- height of the frustuma- height of the apex of the pyramid- Throws:
IllegalArgumentException- ifnis less than 0IllegalArgumentException- ifkis less than 1
-
PyramidFrustum
public PyramidFrustum(double s1, double s2, double h, int n, int k)
Create a frustum of a right square pyramid with its base in the xz-plane, a base side length ofs1, top side length ofs2, and heighth.This model works with either
s1 > s2ors1 < s2. In other words, the frustum can have its "apex" either above or below the xz-plane.- Parameters:
s1- side length of the base of the frustums2- side length of the top of the frustumh- height of the frustumn- number of lines of latitudek- number of lines of longitude- Throws:
IllegalArgumentException- ifnis less than 0IllegalArgumentException- ifkis less than 1
-
-
Method Detail
-
getHorzCount
public int getHorzCount()
- Specified by:
getHorzCountin interfaceMeshMaker- Returns:
- the number of lines of latitude that the
Modelcontains
-
getVertCount
public int getVertCount()
- Specified by:
getVertCountin interfaceMeshMaker- Returns:
- the number of lines of longitude that the
Modelcontains
-
remake
public PyramidFrustum remake(int n, int k)
Description copied from interface:MeshMakerBuild an instance of theModelwith new values for the number of lines of latitude and longitude while keeping all the other model parameters the same.
-
-