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

Ground primitive clipping issue #3706

Closed
mramato opened this issue Mar 15, 2016 · 2 comments · Fixed by #3709
Closed

Ground primitive clipping issue #3706

mramato opened this issue Mar 15, 2016 · 2 comments · Fixed by #3709

Comments

@mramato
Copy link
Contributor

mramato commented Mar 15, 2016

@bagnell here's the bug we were talking about yesterday, not sure if you have a better test case (this one requires @tfili's entity-terrain branch.

Run the below code in Sandcastle and then hit the "Bug" button. Right-click zoom in and out of the rectangle (without rotating) and you will see obvious visual artifacts as the ground primitive seemingly changes size/shape as you zoom. I believe @bagnell said this is a multi-frustum related issue.

var viewer = new Cesium.Viewer('cesiumContainer', {
    baseLayerPicker: false,
    terrainProvider: new Cesium.CesiumTerrainProvider({
        url: '//assets.agi.com/stk-terrain/world'
    })
});


var rect = Cesium.Rectangle.fromDegrees(-85.0, 35.99, -84.99, 36.0);
Sandcastle.addToolbarButton('Bug', function () {
    viewer.entities.add({
        rectangle: {
            coordinates: rect
        }
    });

    viewer.camera.setView({destination: rect});
});
@bagnell
Copy link
Contributor

bagnell commented Mar 15, 2016

Updated code that does not require the entity-terrain branch:

    var viewer = new Cesium.Viewer('cesiumContainer', {
        baseLayerPicker: false,
        terrainProvider: new Cesium.CesiumTerrainProvider({
            url: '//assets.agi.com/stk-terrain/world'
        })
    });

    var rect = Cesium.Rectangle.fromDegrees(-85.0, 35.99, -84.99, 36.0);
    viewer.camera.setView({destination: rect});

    Sandcastle.addToolbarButton('Bug', function () {
        viewer.scene.groundPrimitives.add(new Cesium.GroundPrimitive({
            geometryInstances : new Cesium.GeometryInstance({
                geometry : new Cesium.RectangleGeometry({
                    rectangle : rect
                }),
                attributes: {
                    color: Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 1.0, 0.0, 0.5))
                }
            }),
            asynchronous : false
        }));
    });

@mramato
Copy link
Contributor Author

mramato commented Mar 15, 2016

Thanks @bagnell

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