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

Gaps in polyline geometry #2136

Closed
shunter opened this issue Sep 18, 2014 · 17 comments
Closed

Gaps in polyline geometry #2136

shunter opened this issue Sep 18, 2014 · 17 comments

Comments

@shunter
Copy link
Contributor

shunter commented Sep 18, 2014

Load this CZML:

[
    {
        "id": "document",
        "name": "Scenario1",
        "version": "1.0"
    },
    {
        "polyline": {
            "show":true,
            "followSurface": false,
            "width": 1,
            "material": {
                "solidColor": {
                    "color": {
                        "rgba": [
                            255,0,0,255
                        ]
                    }
                }
            },
            "positions": {
                "cartesian": [
                    -2762311.00830773,-353772.770617956,5744341.1029397,
                    -2761948.53524189,-352540.984668731,5744589.45177038,
                    -2761489.63689365,-351351.015034201,5744881.00673499,
                    -2760501.41649919,-349074.500150257,5745490.59861244,
                    -2747646.68861261,-319548.010372599,5753312.61536235,
                    -2733545.85295945,-287341.396251038,5761666.02374555,
                    -2719184.39340316,-254731.841614883,5769934.23161486,
                    -2704559.57079483,-221720.087399472,5778110.14303044,
                    -2689668.64471426,-188306.948837029,5786186.5665434,
                    -2674508.87484634,-154493.317790999,5794156.21539013,
                    -2659077.5223858,-120280.1651132,5802011.70772228,
                    -2643371.85147054,-85668.54302332,5809745.56687358,
                    -2627389.13064373,-50659.5875102197,5817350.22166467,
                    -2611126.63434506,-15254.5207545123,5824818.00674721,
                    -2594581.64443126,20545.3464281583,5832141.16298856,
                    -2577751.45172612,56738.6121237504,5839311.83789823,
                    -2560633.35760032,93323.7808369763,5846322.08609732,
                    -2543224.67558112,130299.260989649,5853163.86983245,
                    -2525522.73299228,167663.36240089,5859829.05953519,
                    -2507524.87262424,205414.293749881,5866309.4344285,
                    -2489228.45443484,243550.160021986,5872596.68318147,
                    -2470630.85728063,282068.959938905,5878682.40461353,
                    -2451729.4806791,320968.583373724,5884558.10844974,
                    -2432521.74660169,360246.80875169,5890215.21612823,
                    -2413005.10129801,399901.300437544,5895645.0616613,
                    -2393177.01715111,439929.606110341,5900838.8925516,
                    -2373034.99456407,480329.154126656,5905787.8707645,
                    -2352576.56387787,521097.250873157,5910483.0737584,
                    -2331799.28732069,562231.078109538,5914915.495574
               ]
            }
        }
    },
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2762311.00830773,-353772.770617956,5744341.1029397]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2761948.53524189,-352540.984668731,5744589.45177038]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2761489.63689365,-351351.015034201,5744881.00673499]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2760501.41649919,-349074.500150257,5745490.59861244]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2747646.68861261,-319548.010372599,5753312.61536235]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2733545.85295945,-287341.396251038,5761666.02374555]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2719184.39340316,-254731.841614883,5769934.23161486]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2704559.57079483,-221720.087399472,5778110.14303044]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2689668.64471426,-188306.948837029,5786186.5665434]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2674508.87484634,-154493.317790999,5794156.21539013]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2659077.5223858,-120280.1651132,5802011.70772228]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2643371.85147054,-85668.54302332,5809745.56687358]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2627389.13064373,-50659.5875102197,5817350.22166467]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2611126.63434506,-15254.5207545123,5824818.00674721]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2594581.64443126,20545.3464281583,5832141.16298856]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2577751.45172612,56738.6121237504,5839311.83789823]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2560633.35760032,93323.7808369763,5846322.08609732]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2543224.67558112,130299.260989649,5853163.86983245]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2525522.73299228,167663.36240089,5859829.05953519]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2507524.87262424,205414.293749881,5866309.4344285]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2489228.45443484,243550.160021986,5872596.68318147]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2470630.85728063,282068.959938905,5878682.40461353]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2451729.4806791,320968.583373724,5884558.10844974]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2432521.74660169,360246.80875169,5890215.21612823]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2413005.10129801,399901.300437544,5895645.0616613]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2393177.01715111,439929.606110341,5900838.8925516]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2373034.99456407,480329.154126656,5905787.8707645]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2352576.56387787,521097.250873157,5910483.0737584]}},
{"point":{"color":{"rgba":[0,0,255,255]},"pixelSize":5},"position":{"cartesian":[-2331799.28732069,562231.078109538,5914915.495574]}}
]

This creates a polyline, and also creates points at each position of the polyline for reference. (The points are not part of the problem)

There's a gap in the polyline between two of the points:

image

@hpinkos
Copy link
Contributor

hpinkos commented Sep 26, 2014

image

@shunter I couldn't reproduce this. Are you still seeing this problem?

@pjcozzi
Copy link
Contributor

pjcozzi commented Sep 27, 2014

I can't reproduce it either.

@mramato
Copy link
Contributor

mramato commented Sep 30, 2014

I can reproduce this every time in IE. I've also seen it in Chrome but only on certain systems.

image

@shunter
Copy link
Contributor Author

shunter commented Oct 3, 2014

My thought was that it was related to the DX11 backend somehow. I can still reproduce in Chrome beta, but it's fine in Firefox (which is using DX9 still)

@pjcozzi
Copy link
Contributor

pjcozzi commented Oct 3, 2014

Is there still a D3D 9/11 flag in chrome://flags/?

@shunter
Copy link
Contributor Author

shunter commented Oct 3, 2014

In 38 beta I don't see any flag related to the DirectX or Direct3D version.

@mramato
Copy link
Contributor

mramato commented Oct 3, 2014

It happens in IE 11 for me on every machine I try it on. It only happens in Chrome on machines using DX9 back-end. I can try Linux when I get home later.

@GatorScott
Copy link

I just "synced" and built cesium master and no lines are being drawn, just dots.

@GatorScott
Copy link

IE 11.0.9600.17280 - Dots only
Firefox 17.0.7 - Dots only
Chrome 37.0.2062.124 m - Dots only, no textures on globe.

@GatorScott
Copy link

I am currently seeing this with agi-cesium "head" on my laptop in IE 11.0.9600.17280 using NVIDIA K1000M.

@GatorScott
Copy link

The gap I'm seeing is when the line crosses the anti-meridian (yellow).

image

@mramato
Copy link
Contributor

mramato commented Oct 4, 2014

I think @GatorScott is on to something because I can reproduce this in Chrome on Linux and obviously that's using OpenGL directly.

@mramato
Copy link
Contributor

mramato commented Oct 9, 2014

FYI, This does not happen if you use SimplePolylineGeometry instead of PolylineGeometry. I'm not sure what the exact implications of that are, but it should cut out a lot of the geometry pipeline as the potential source of the problem. Here's a complete Sandcastle example that can be used to debug this. Just set useSimple to true to see the problem go away.

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

var values = [-2762311.00830773, -353772.770617956, 5744341.1029397, 
              -2761948.53524189, -352540.984668731, 5744589.45177038, 
              -2761489.63689365, -351351.015034201, 5744881.00673499, 
              -2760501.41649919, -349074.500150257, 5745490.59861244, 
              -2747646.68861261, -319548.010372599, 5753312.61536235, 
              -2733545.85295945, -287341.396251038, 5761666.02374555, 
              -2719184.39340316, -254731.841614883, 5769934.23161486, 
              -2704559.57079483, -221720.087399472, 5778110.14303044, 
              -2689668.64471426, -188306.948837029, 5786186.5665434, 
              -2674508.87484634, -154493.317790999, 5794156.21539013, 
              -2659077.5223858, -120280.1651132, 5802011.70772228, 
              -2643371.85147054, -85668.54302332, 5809745.56687358, 
              -2627389.13064373, -50659.5875102197, 5817350.22166467, 
              -2611126.63434506, -15254.5207545123, 5824818.00674721, 
              -2594581.64443126, 20545.3464281583, 5832141.16298856, 
              -2577751.45172612, 56738.6121237504, 5839311.83789823, 
              -2560633.35760032, 93323.7808369763, 5846322.08609732, 
              -2543224.67558112, 130299.260989649, 5853163.86983245, 
              -2525522.73299228, 167663.36240089, 5859829.05953519, 
              -2507524.87262424, 205414.293749881, 5866309.4344285, 
              -2489228.45443484, 243550.160021986, 5872596.68318147, 
              -2470630.85728063, 282068.959938905, 5878682.40461353, 
              -2451729.4806791, 320968.583373724, 5884558.10844974, 
              -2432521.74660169, 360246.80875169, 5890215.21612823, 
              -2413005.10129801, 399901.300437544, 5895645.0616613, 
              -2393177.01715111, 439929.606110341, 5900838.8925516, 
              -2373034.99456407, 480329.154126656, 5905787.8707645, 
              -2352576.56387787, 521097.250873157, 5910483.0737584, 
              -2331799.28732069, 562231.078109538, 5914915.495574];

var result = [];
for (var i = 0; i < values.length; i += 3) {
    result[i / 3] = new Cesium.Cartesian3(values[i], values[i + 1], values[i + 2]);
}

var G = Cesium.PolylineGeometry;
var A = Cesium.PolylineColorAppearance;
if (useSimple) {
    G = Cesium.SimplePolylineGeometry;
    A = Cesium.PerInstanceColorAppearance;
}

var yellowPolyline = new Cesium.GeometryInstance({
    geometry : new G({
        positions : result
    }),
    attributes : {
        color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOW)
    }
});

primitives.add(new Cesium.Primitive({
    geometryInstances : yellowPolyline,
    appearance : new A({
        flat : true
    })
}));

@pjcozzi
Copy link
Contributor

pjcozzi commented Oct 9, 2014

Small chance but perhaps related to #1248

@mramato
Copy link
Contributor

mramato commented Nov 7, 2014

This appears to be fixed (probably by #2242) @shunter can you confirm?

@shunter
Copy link
Contributor Author

shunter commented Nov 7, 2014

The test case I pasted above is fixed, but my original CZML (which I can't share publicly) still has the problem. I'll try to pull out another test case.

@shunter
Copy link
Contributor Author

shunter commented Nov 7, 2014

OK, here's a new test case. Sandcastle example:

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

var czml =[
  {
    "id":"document",
    "version":"1.0"
  },
  {
    "id":"route",
    "polyline":{
      "followSurface":false,
      "width":1,
      "material":{
        "solidColor":{
          "color":{
            "rgba":[
              255,0,0,255
            ]
          }
        }
      },
      "positions":{
        "cartesian":[
-1607793.87907149,-5164461.06063949,3411705.34556153,
-1585713.93720536,-5174609.42604913,3406692.04771375,
-1563214.45610857,-5184859.67459552,3401536.20379345,
-1563214.45610849,-5184859.67459555,3401536.20379344,
-1561976.38119411,-5185460.98932304,3401190.6335343,
-1561642.80317046,-5185637.44746062,3401075.5487791,
-1560178.73941077,-5186495.10130118,3400443.88062164,
-1558843.00025796,-5187419.9641181,3399650.94454107,
-1557654.31073042,-5188398.47902466,3398708.75659211,
-1556629.1367245,-5189416.41627547,3397631.3954333,
-1555781.4783554,-5190459.08947485,3396434.76839922,
-1555122.70609494,-5191511.57186964,3395136.35776428,
-1554661.4391469,-5192558.90927159,3393754.95271154,
-1554403.46455111,-5193586.32686177,3392310.37188104,
-1554351.69494802,-5194579.4278151,3390823.18058573,
-1554506.16275152,-5195524.38227224,3389314.40597153,
-1554864.04861189,-5196408.10562399,3387805.25267016,
-1555419.7424124,-5197218.42532891,3386316.82093771,
-1556164.93552407,-5197944.23555468,3384869.82894568,
-1557088.74352759,-5198575.63883322,3383484.34081979,
-1558177.85899019,-5199104.07369105,3382179.50219693,
-1559416.73406462,-5199522.42691049,3380973.2854523,
-1560787.79258979,-5199825.12876183,3379882.24726997,
-1562271.67098309,-5200008.22928755,3378921.30180266,
-1563847.48652703,-5200069.45358316,3378103.51319093,
-1565493.13071262,-5200008.23405734,3377439.91158593,
-1567185.58419128,-5199825.7179017,3376939.3369538,
-1568901.2487209,-5199524.74846658,3376608.31476741,
-1570616.29040082,-5199109.81990407,3376450.96718048,
-1572306.98760949,-5198587.00525714,3376468.96244105,
-1572306.98760979,-5198587.00525703,3376468.96244107,
-1573610.48247865,-5198138.75742121,3376551.27963324,
-1589321.18008261,-5192715.15362984,3377531.36247231
        ]
      }
    }
  }
];

var czmlDataSource = new Cesium.CzmlDataSource();
czmlDataSource.load(czml, 'Built-in CZML');
viewer.dataSources.add(czmlDataSource);

scene.camera.viewRectangle(Cesium.Rectangle.fromDegrees(-108, 31, -105, 33));

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

No branches or pull requests

6 participants