public class Primitives extends Object
Geometry
or SceneGraphComponent
. The main categories of
primitives are:
Note: many of these methods could perhaps profitably be replaced with factory classes.
Modifier and Type | Field and Description |
---|---|
static double[][] |
icoVerts3 |
static IndexedFaceSet |
sharedIcosahedron |
Modifier and Type | Method and Description |
---|---|
static IndexedLineSet |
arrow(double x0,
double y0,
double x1,
double y1,
double tipSize) |
static IndexedLineSet |
arrow(double x0,
double y0,
double x1,
double y1,
double tipSize,
boolean halfArrow)
Generate an an arrow: a line segment joining (x0,y0) to (x1,y1) with a head at the
second point, each half making a 45 degree angle to the segment.
|
static IndexedFaceSet |
box(double width,
double height,
double depth,
boolean colored)
Same as
#box(double, double, double, boolean, Pn.EUCLIDEAN) |
static IndexedFaceSet |
box(double width,
double height,
double depth,
boolean colored,
int metric)
A box centered at the origin.
|
static IndexedFaceSetFactory |
boxFactory(double width,
double height,
double depth,
boolean colored,
int metric) |
static SceneGraphComponent |
clippingPlane(double[] plane) |
static SceneGraphComponent |
clippingPlane(double[] plane,
int sig)
Create a clipping plane with the given plane equation with the given metric.
|
static SceneGraphComponent |
closedCylinder(int n,
double r,
double zmin,
double zmax,
double thetamax) |
static SceneGraphComponent |
closedCylinder(int n,
double r,
double R,
double zmin,
double zmax,
double thetamax) |
static IndexedFaceSet |
coloredCube() |
static IndexedFaceSet |
coloredCube(double width,
double height,
double depth)
Deprecated.
Use
#box(double, double, double, true) |
static IndexedFaceSet |
coloredTetrahedron() |
static IndexedFaceSet |
cone(int n)
a simple cone with tip at (0,0,1)
radius 1 on the XY axis
|
static IndexedFaceSet |
cone(int n,
double h) |
static IndexedFaceSet |
cube() |
static IndexedFaceSet |
cube(boolean colored)
A cube.
|
static IndexedFaceSet |
cube(double width,
double height,
double depth)
Deprecated.
Use
#box(double, double, double, false) |
static IndexedFaceSet |
cube(double width,
double height,
double depth,
boolean colored)
Deprecated.
|
static IndexedFaceSet |
cube4(boolean colored)
A cube.
|
static IndexedFaceSet |
cylinder(int n)
A unit euclidean cylinder approximated by a prism with nsides.
|
static IndexedFaceSet |
cylinder(int n,
double r,
double zmin,
double zmax,
double thetamax)
A renderMan-style cylinder specification (implicitly euclidean)
|
static IndexedFaceSet |
cylinder(int n,
double r,
double R,
double zmin,
double zmax,
double thetamax) |
static IndexedFaceSet |
cylinder(int n,
double r,
double R,
double zmin,
double zmax,
double thetamax,
int res) |
static IndexedLineSet |
discreteTorusKnot(double R,
double r,
int n,
int m,
int nPts)
Generate a torus knot that winds around the given torus the given number of times.
|
static IndexedFaceSet |
icosahedron() |
static SceneGraphComponent |
labelPoint(SceneGraphComponent sgc,
double[] center,
String label) |
static IndexedFaceSet |
openCube() |
static PointSet |
point(double[] center) |
static PointSet |
point(double[] center,
String label)
A single point as a
PointSet . |
static IndexedFaceSet |
pyramid(double[][] base,
double[] tip)
A pyramid: a cone with vertex tip over the polygon base.
|
static IndexedFaceSet |
regularAnnulus(int order,
double offset,
double r) |
static IndexedFaceSet |
regularPolygon(int order)
Construct a regular polygon lying in the (x,y) plane, lying on the unit-circle there,
and having order edges.
|
static IndexedFaceSet |
regularPolygon(int order,
double offset)
Construct a regular polygon lying in the (x,y) plane, lying on the unit-circle there,
and having order edges.
|
static IndexedFaceSetFactory |
regularPolygonFactory(int order,
double offset) |
static double[][] |
regularPolygonVertices(int order,
double offset) |
static SceneGraphComponent |
sphere(double radius,
double[] center)
A euclidean sphere with given radius and center.
|
static SceneGraphComponent |
sphere(double radius,
double[] center,
int metric)
A sphere with given radius and center, with the given metric metric.
|
static SceneGraphComponent |
sphere(double radius,
double x,
double y,
double z)
A euclidean sphere with given radius and center.
|
static IndexedFaceSet |
sphere(int detail)
Create a unit sphere centered at the origin
using latitude/longitude parametrization.
|
static IndexedFaceSet |
tetrahedron() |
static IndexedFaceSet |
tetrahedron(boolean colored)
A tetrahedron.
|
static IndexedFaceSet |
texturedBox(double width,
double height,
double depth)
Generate a box with texture coordinates obtained from the vertex coordinates.
|
static IndexedFaceSet |
texturedQuadrilateral() |
static IndexedFaceSet |
texturedQuadrilateral(double[] points) |
static IndexedFaceSetFactory |
texturedQuadrilateralFactory()
Generate a textured quadrilateral using the given array points.
|
static IndexedFaceSetFactory |
texturedQuadrilateralFactory(double[] points) |
static IndexedFaceSet |
torus(double bR,
double sR,
int bDetail,
int sDetail)
Create a torus with the given parameters.
|
static SceneGraphComponent |
wireframeSphere() |
static SceneGraphComponent |
wireframeSphere(int w,
int h)
A
SceneGraphComponent with wire-frame sphere (azimuth/elevation coordinate mesh) |
public static double[][] icoVerts3
public static IndexedFaceSet sharedIcosahedron
public static IndexedFaceSet cube()
public static IndexedFaceSet coloredCube()
public static IndexedFaceSet openCube()
public static IndexedFaceSet cube4(boolean colored)
colored
- public static IndexedFaceSet cube(boolean colored)
colored
- public static IndexedFaceSet cube(double width, double height, double depth, boolean colored)
box(double, double, double, boolean)
.public static IndexedFaceSet box(double width, double height, double depth, boolean colored)
#box(double, double, double, boolean, Pn.EUCLIDEAN)
public static IndexedFaceSet box(double width, double height, double depth, boolean colored, int metric)
width
- x-dimheight
- y-dimdepth
- z-dimcolored
- provide face colors?metric
- the metricpublic static IndexedFaceSetFactory boxFactory(double width, double height, double depth, boolean colored, int metric)
public static IndexedFaceSet coloredCube(double width, double height, double depth)
#box(double, double, double, true)
width
- height
- depth
- public static IndexedFaceSet cube(double width, double height, double depth)
#box(double, double, double, false)
width
- height
- depth
- public static IndexedFaceSet tetrahedron()
public static IndexedFaceSet coloredTetrahedron()
public static IndexedFaceSet tetrahedron(boolean colored)
colored
- public static IndexedFaceSet icosahedron()
public static PointSet point(double[] center)
public static PointSet point(double[] center, String label)
PointSet
.center
- public static SceneGraphComponent labelPoint(SceneGraphComponent sgc, double[] center, String label)
public static SceneGraphComponent sphere(double radius, double x, double y, double z)
radius
- x
- y
- z
- public static SceneGraphComponent sphere(double radius, double[] center)
radius
- center
- public static SceneGraphComponent sphere(double radius, double[] center, int metric)
radius
- center
- metric
- public static SceneGraphComponent wireframeSphere()
public static SceneGraphComponent wireframeSphere(int w, int h)
SceneGraphComponent
with wire-frame sphere (azimuth/elevation coordinate mesh)public static IndexedFaceSet cylinder(int n)
n
- Cylinder
public static IndexedFaceSet cylinder(int n, double r, double zmin, double zmax, double thetamax)
n
- r
- zmin
- zmax
- thetamax
- public static IndexedFaceSet cylinder(int n, double r, double R, double zmin, double zmax, double thetamax)
public static IndexedFaceSet cylinder(int n, double r, double R, double zmin, double zmax, double thetamax, int res)
public static SceneGraphComponent closedCylinder(int n, double r, double zmin, double zmax, double thetamax)
public static SceneGraphComponent closedCylinder(int n, double r, double R, double zmin, double zmax, double thetamax)
public static IndexedFaceSet cone(int n)
n
- public static IndexedFaceSet cone(int n, double h)
public static IndexedFaceSet pyramid(double[][] base, double[] tip)
base
- tip
- public static IndexedLineSet discreteTorusKnot(double R, double r, int n, int m, int nPts)
R
- major radiusr
- minor radiusn
- number of windings around the big circlem
- number of windings around the small (meridianal) circlenPts
- how many segments in the resulting curve.public static IndexedFaceSet regularPolygon(int order)
order
- public static IndexedFaceSet regularPolygon(int order, double offset)
order
- number of Verticesoffset
- public static IndexedFaceSetFactory regularPolygonFactory(int order, double offset)
public static double[][] regularPolygonVertices(int order, double offset)
public static IndexedFaceSet regularAnnulus(int order, double offset, double r)
public static IndexedLineSet arrow(double x0, double y0, double x1, double y1, double tipSize)
arrow(double, double, double, double, double, boolean)
with final parameter false.public static IndexedLineSet arrow(double x0, double y0, double x1, double y1, double tipSize, boolean halfArrow)
x0
- y0
- x1
- y1
- tipSize
- Scaling factor for the head of the arrow. Value of 1 makes it as big as the arrow itself.halfArrow
- public static SceneGraphComponent clippingPlane(double[] plane)
clippingPlane(double[], int)
with second argument = Pn.EUCLIDEAN
.public static SceneGraphComponent clippingPlane(double[] plane, int sig)
plane
- sig
- public static IndexedFaceSet torus(double bR, double sR, int bDetail, int sDetail)
Geometry
Attribute
so that the RenderMan viewer de.jreality.renderman.RIBViewer
will produce an exact torus.bR
- Major radiussR
- Minor radiusbDetail
- Number of sample points around major circlesDetail
- Number of sample points around minor circlepublic static IndexedFaceSet sphere(int detail)
detail
- public static IndexedFaceSet texturedQuadrilateral()
public static IndexedFaceSet texturedQuadrilateral(double[] points)
public static IndexedFaceSetFactory texturedQuadrilateralFactory()
points
- public static IndexedFaceSetFactory texturedQuadrilateralFactory(double[] points)
public static IndexedFaceSet texturedBox(double width, double height, double depth)
width
- x-dimheight
- y-dimdepth
- z-dim