Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Material issues when applied to EllipsoidGeometry #1454

Closed
bagnell opened this issue Feb 10, 2014 · 0 comments · Fixed by #1498
Closed

Material issues when applied to EllipsoidGeometry #1454

bagnell opened this issue Feb 10, 2014 · 0 comments · Fixed by #1498

Comments

@bagnell
Copy link
Contributor

bagnell commented Feb 10, 2014

Using this code in the Sandcastle with a viewer:

    var scene = viewer.scene;
    var primitives = scene.getPrimitives();
    var ellipsoid = viewer.centralBody.getEllipsoid();

    // Create ellipsoid and place with model matrix
    var radii = new Cesium.Cartesian3(200000.0, 200000.0, 300000.0);
    var positionOnEllipsoid = ellipsoid.cartographicToCartesian(Cesium.Cartographic.fromDegrees(-100.0, 40.0));
    var modelMatrix = Cesium.Matrix4.multiplyByTranslation(
        Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid),
        new Cesium.Cartesian3(0.0, 0.0, radii.z)
    );

    var ellipsoidGeometry = new Cesium.EllipsoidGeometry({
        vertexFormat : Cesium.MaterialAppearance.MaterialSupport.ALL.vertexFormat,
        radii : radii
    });
    var ellipsoidInstance = new Cesium.GeometryInstance({
        geometry : ellipsoidGeometry,
        modelMatrix : modelMatrix
    });
    primitives.add(new Cesium.Primitive({
        geometryInstances : ellipsoidInstance,
        appearance : new Cesium.MaterialAppearance({
            material : Cesium.Material.fromType(Cesium.Material.GridType),
            materialSupport : Cesium.MaterialAppearance.MaterialSupport.ALL,
            translucent : true,
            closed : true
        })
    }));

You will see:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants