Package renderer.models_L
Class ConeFrustum
- java.lang.Object
-
- renderer.scene.Model
-
- renderer.models_L.ConeFrustum
-
- All Implemented Interfaces:
MeshMaker
public class ConeFrustum extends Model implements MeshMaker
Create a wireframe model of a frustum of a right circular cone with its base in the xz-plane.- See Also:
Cone,ConeSector
-
-
Constructor Summary
Constructors Constructor Description ConeFrustum()Create a frustum of a right circular cone with its base in the xz-plane, a base radius of 1, top radius of 1/2, and height 1/2.ConeFrustum(double r1, double h, double r2, int n, int k)Create a frustum of a right circular cone with its base in the xz-plane, a base radius ofr1, top radius ofr2, and heighth.ConeFrustum(int n, int k, double r, double h, double a)Create a frustum of a right circular cone with its base in the xz-plane, a base radius ofr, top of the frustum at heighth, and with the cone's apex on the y-axis at heighta.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetHorzCount()intgetVertCount()ConeFrustumremake(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
-
ConeFrustum
public ConeFrustum()
Create a frustum of a right circular cone with its base in the xz-plane, a base radius of 1, top radius of 1/2, and height 1/2.
-
ConeFrustum
public ConeFrustum(int n, int k, double r, double h, double a)
Create a frustum of a right circular cone with its base in the xz-plane, a base radius ofr, top of the frustum at heighth, and with the cone's apex on the y-axis at heighta.There must be at least three lines of longitude and at least two circles of latitude.
- Parameters:
n- number of circles of latitudek- number of lines of longituder- radius of the base in the xz-planeh- height of the frustuma- height of the apex of the cone- Throws:
IllegalArgumentException- ifnis less than 2IllegalArgumentException- ifkis less than 3
-
ConeFrustum
public ConeFrustum(double r1, double h, double r2, int n, int k)
Create a frustum of a right circular cone with its base in the xz-plane, a base radius ofr1, top radius ofr2, and heighth.This model works with either
r1 > r2orr1 < r2. In other words, the frustum can have its "apex" either above or below the xz-plane.There must be at least three lines of longitude and at least two circles of latitude.
- Parameters:
r1- radius of the base of the frustumh- height of the frustumr2- radius of the top of the frustumn- number of circles of latitudek- number of lines of longitude- Throws:
IllegalArgumentException- ifnis less than 2IllegalArgumentException- ifkis less than 3
-
-
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 ConeFrustum 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.
-
-