Package renderer.models_L
Class Octahedron
- java.lang.Object
-
- renderer.scene.Model
-
- renderer.models_L.Octahedron
-
- All Implemented Interfaces:
MeshMaker
public class Octahedron extends Model implements MeshMaker
Create a wireframe model of a regular octahedron with its center at the origin, having side lengthsqrt(2) = 1.4142,with its center plane given by the four vertices(±1, 0, ±1). and with the top and bottom vertices being(0, ±1, 0).- See Also:
Tetrahedron,Cube,Icosahedron,Dodecahedron
-
-
Field Summary
Fields Modifier and Type Field Description intn1intn2intn3-
Fields inherited from class renderer.scene.Model
colorList, name, primitiveList, vertexList, visible
-
-
Constructor Summary
Constructors Constructor Description Octahedron()Create a regular octahedron with its center at the origin, having side lengthsqrt(2) = 1.4142, with its center plane given by the four vertices(±1, 0, ±1).Octahedron(int n)Create a regular octahedron with its center at the origin, having side lengthsqrt(2) = 1.4142, with its center plane given by the four vertices(±1, 0, ±1).Octahedron(int n1, int n2, int n3)Create a regular octahedron with its center at the origin, having side lengthsqrt(2) = 1.4142, with its center plane given by the four vertices(±1, 0, ±1).Octahedron(int n1a, int n1b, int n2a, int n2b, int n3a, int n3b)Create a regular octahedron with its center at the origin, having side lengthsqrt(2) = 1.4142, with its center plane given by the four vertices(±1, 0, ±1).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetHorzCount()intgetVertCount()Octahedronremake(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
-
Octahedron
public Octahedron()
Create a regular octahedron with its center at the origin, having side lengthsqrt(2) = 1.4142, with its center plane given by the four vertices(±1, 0, ±1). and with the top and bottom vertices being(0, ±1, 0).
-
Octahedron
public Octahedron(int n)
Create a regular octahedron with its center at the origin, having side lengthsqrt(2) = 1.4142, with its center plane given by the four vertices(±1, 0, ±1). and with the top and bottom vertices being(0, ±1, 0).Add line segments fanning out from the top and bottom vertices to the sides around the center plane.
- Parameters:
n- number of lines fanning out from the top and bottom on each side of the octahedron- Throws:
IllegalArgumentException- ifn1is less than 0IllegalArgumentException- ifn2is less than 0
-
Octahedron
public Octahedron(int n1, int n2, int n3)
Create a regular octahedron with its center at the origin, having side lengthsqrt(2) = 1.4142, with its center plane given by the four vertices(±1, 0, ±1). and with the top and bottom vertices being(0, ±1, 0).Add line segments fanning out from each vertex to its opposite sides.
- Parameters:
n1- number of lines fanning out from the top and bottom on each side of the octahedronn2- number of lines fanning out from v0 and v2 on each side of the octahedronn3- number of lines fanning out from v1 and v3 on each side of the octahedron- Throws:
IllegalArgumentException- ifn1is less than 0IllegalArgumentException- ifn2is less than 0IllegalArgumentException- ifn3is less than 0
-
Octahedron
public Octahedron(int n1a, int n1b, int n2a, int n2b, int n3a, int n3b)
Create a regular octahedron with its center at the origin, having side lengthsqrt(2) = 1.4142, with its center plane given by the four vertices(±1, 0, ±1). and with the top and bottom vertices being(0, ±1, 0).Add line segments fanning out from each vertex to its opposite sides.
- Parameters:
n1a- number of lines fanning out from the top on each side of the octahedronn1b- number of lines fanning out from the bottom on each side of the octahedronn2a- number of lines fanning out from v0 on each side of the octahedronn2b- number of lines fanning out from v1 on each side of the octahedronn3a- number of lines fanning out from v2 on each side of the octahedronn3b- number of lines fanning out from v3 on each side of the octahedron- Throws:
IllegalArgumentException- ifn1ais less than 0IllegalArgumentException- ifn1bis less than 0IllegalArgumentException- ifn2ais less than 0IllegalArgumentException- ifn2bis less than 0IllegalArgumentException- ifn3ais less than 0IllegalArgumentException- ifn3bis less than 0
-
-
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 Octahedron 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.
-
-