public class SphereUtility extends Object
de.jreality.jogl
for quick rendering of
spherical representations of points.
Warning: the approximation methods here have an upper limit on the fineness of the approximation which they are prepared to calculate. These limits should problably be removed.
Modifier and Type | Field and Description |
---|---|
static int |
SPHERE_COARSE |
static int |
SPHERE_FINE |
static int |
SPHERE_FINER |
static int |
SPHERE_FINEST |
static int |
SPHERE_SUPERFINE |
static int |
SPHERE_WAYFINE |
Modifier and Type | Method and Description |
---|---|
static void |
assignSphericalUVs(PointSet ps,
double[] center) |
static void |
colorizeSphere(PointSet ps,
double[] center,
ColorGradient cg)
Calculated the distance from center ( [0,0,0] if center is null ) for each vertex and sets vertex
colors from the given Color Gradient (d_min->0, d_max-_1).
|
static void |
dispose() |
static Rectangle3D |
getSphereBoundingBox()
Return a standard bounding box for a unit sphere.
|
static double[][] |
getTC(double[][] sphere) |
static double[][] |
getTC(double[][] sphere,
int[] channels) |
static IndexedFaceSet |
sphericalPatch(double cU,
double cV,
double uSize,
double vSize,
int xDetail,
int yDetail,
double radius) |
static QuadMeshFactory |
sphericalPatchFactory(double cU,
double cV,
double uSize,
double vSize,
int xDetail,
int yDetail,
double radius)
Generate a spherical patch.
|
static SceneGraphComponent |
tessellatedCubeSphere(int i)
Return a tessellated cube of order i.
|
static SceneGraphComponent |
tessellatedCubeSphere(int i,
boolean sharedInstance) |
static IndexedFaceSet |
tessellatedIcosahedronSphere(int i) |
static IndexedFaceSet |
tessellatedIcosahedronSphere(int i,
boolean sharedInstance)
Return a tessellated icosahedron of order i.
|
public static int SPHERE_COARSE
public static int SPHERE_FINE
public static int SPHERE_FINER
public static int SPHERE_FINEST
public static int SPHERE_SUPERFINE
public static int SPHERE_WAYFINE
public static void dispose()
public static IndexedFaceSet tessellatedIcosahedronSphere(int i)
public static IndexedFaceSet tessellatedIcosahedronSphere(int i, boolean sharedInstance)
i
- sharedInstance
- public static double[][] getTC(double[][] sphere)
public static double[][] getTC(double[][] sphere, int[] channels)
public static SceneGraphComponent tessellatedCubeSphere(int i)
i
- public static SceneGraphComponent tessellatedCubeSphere(int i, boolean sharedInstance)
public static Rectangle3D getSphereBoundingBox()
public static IndexedFaceSet sphericalPatch(double cU, double cV, double uSize, double vSize, int xDetail, int yDetail, double radius)
public static QuadMeshFactory sphericalPatchFactory(double cU, double cV, double uSize, double vSize, int xDetail, int yDetail, double radius)
cU
- cV
- uSize
- wdith of the patch (longitude)vSize
- height of the patch (latitude)n
- number of sample points in um
- number of sample points in vr
- radius of the spherepublic static void colorizeSphere(PointSet ps, double[] center, ColorGradient cg)
ps
- the PointSet to set vertex colorscenter
- optional centercg
- optional color color gradient
TODO: adapt to homogenious coordinatespublic static void assignSphericalUVs(PointSet ps, double[] center)