new EllipsoidPrimitive(options)
A renderable ellipsoid. It can also draw spheres when the three
EllipsoidPrimitive#radii components are equal.
This is only supported in 3D. The ellipsoid is not shown in 2D or Columbus view.
| Name | Type | Description | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
optional
Object with the following properties:
|
Examples:
// 1. Create a sphere using the ellipsoid primitive
primitives.add(new Cesium.EllipsoidPrimitive({
center : Cesium.Cartesian3.fromDegrees(-75.0, 40.0, 500000.0),
radii : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0)
}));
// 2. Create a tall ellipsoid in an east-north-up reference frame
var e = new Cesium.EllipsoidPrimitive();
e.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(
Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0));
e.radii = new Cesium.Cartesian3(100000.0, 100000.0, 200000.0);
primitives.add(e);
Demo:
Members
-
center :Cartesian3
-
The center of the ellipsoid in the ellipsoid's model coordinates.
The default is
Cartesian3.ZERO.-
Default Value:
Cartesian3.ZEROSee:
-
debugShowBoundingVolume :Boolean
-
This property is for debugging only; it is not for production use nor is it optimized.
Draws the bounding sphere for each draw command in the primitive.
-
Default Value:
false -
id :Object
-
User-defined object returned when the ellipsoid is picked.
-
Default Value:
undefinedSee:
-
material :Material
-
The surface appearance of the ellipsoid. This can be one of several built-in
Materialobjects or a custom material, scripted with Fabric.The default material is
Material.ColorType.-
Default Value:
Material.fromType(Material.ColorType)Example:
// 1. Change the color of the default material to yellow e.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0); // 2. Change material to horizontal stripes e.material = Cesium.Material.fromType(Material.StripeType);See:
-
modelMatrix :Matrix4
-
The 4x4 transformation matrix that transforms the ellipsoid from model to world coordinates. When this is the identity matrix, the ellipsoid is drawn in world coordinates, i.e., Earth's WGS84 coordinates. Local reference frames can be used by providing a different transformation matrix, like that returned by
Transforms.eastNorthUpToFixedFrame.-
Default Value:
Matrix4.IDENTITYExample:
var origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0); e.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin); -
radii :Cartesian3
-
The radius of the ellipsoid along the
x,y, andzaxes in the ellipsoid's model coordinates. When these are the same, the ellipsoid is a sphere.The default is
undefined. The ellipsoid is not drawn until a radii is provided.-
Default Value:
undefinedExample:
// A sphere with a radius of 2.0 e.radii = new Cesium.Cartesian3(2.0, 2.0, 2.0);See:
-
show :Boolean
-
Determines if the ellipsoid primitive will be shown.
-
Default Value:
true
Methods
-
destroy() → undefined
-
Destroys the WebGL resources held by this object. Destroying an object allows for deterministic release of WebGL resources, instead of relying on the garbage collector to destroy this object.
Once an object is destroyed, it should not be used; calling any function other thanisDestroyedwill result in aDeveloperErrorexception. Therefore, assign the return value (undefined) to the object as done in the example.Returns:
Throws:
-
DeveloperError : This object was destroyed, i.e., destroy() was called.
Example:
e = e && e.destroy();See:
-
-
isDestroyed() → Boolean
-
Returns true if this object was destroyed; otherwise, false.
If this object was destroyed, it should not be used; calling any function other thanisDestroyedwill result in aDeveloperErrorexception.Returns:
trueif this object was destroyed; otherwise,false. -
update()
-
Called when
ViewerorCesiumWidgetrender the scene to get the draw commands needed to render this primitive.Do not call this function directly. This is documented just to list the exceptions that may be propagated when the scene is rendered:
Throws:
-
DeveloperError : this.material must be defined.
-
