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

PolylineVolumeGeometry binormals are incorrect #3609

Open
hpinkos opened this issue Feb 19, 2016 · 1 comment
Open

PolylineVolumeGeometry binormals are incorrect #3609

hpinkos opened this issue Feb 19, 2016 · 1 comment

Comments

@hpinkos
Copy link
Contributor

hpinkos commented Feb 19, 2016

It uses GeometryPipeline.computeBinormalandTangent.
At some point, r = Infinity, causing NaN later down the line
https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Core/GeometryPipeline.js#L1282

Demo:

var viewer = new Cesium.Viewer('cesiumContainer');
var scene = viewer.scene;

var shape = [new Cesium.Cartesian2(-10000, -10000), new Cesium.Cartesian2(10000, -10000), new Cesium.Cartesian2(10000, 10000), new Cesium.Cartesian2(-10000, 10000)];

var redTube = new Cesium.GeometryInstance({
    geometry : Cesium.PolylineVolumeGeometry.createGeometry(new Cesium.PolylineVolumeGeometry({
            vertexFormat : Cesium.VertexFormat.ALL,
            polylinePositions : Cesium.Cartesian3.fromDegreesArray([
                 90.0, -30.0,
                 90.0, -35.0
            ]),
            cornerType: Cesium.CornerType.MITERED,
            shapePositions: shape
    })),
    attributes : {
        color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED)
    }
});

scene.primitives.add(new Cesium.Primitive({
    geometryInstances : redTube,
    asynchronous: false,
    appearance : new Cesium.DebugAppearance({
          attributeName : 'st'
        })
    }));

var g = Cesium.PolylineVolumeGeometry.createGeometry(new Cesium.PolylineVolumeGeometry({
    vertexFormat : new Cesium.VertexFormat({position: true, normal: true, binormal: true}),
            polylinePositions : Cesium.Cartesian3.fromDegreesArray([
                 90.0, -30.0,
                 90.0, -35.0
            ]),
            cornerType: Cesium.CornerType.MITERED,
            shapePositions: shape
    }));
g.attributes.normal = undefined;
scene.primitives.add(Cesium.createTangentSpaceDebugPrimitive({
     geometry : g,
     length : 100000.0,
}));
@hpinkos hpinkos changed the title PolylineVolumeGeometry binormals are incorrect for a box PolylineVolumeGeometry binormals are incorrect Feb 19, 2016
@mramato
Copy link
Contributor

mramato commented Jun 23, 2016

It would be really nice to get #3605 into master (which depends on this). How hard is this going to be to fix?

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

No branches or pull requests

3 participants