Trouble formatting agi_rectangularSensor in CZML

Hi all,

I’ve been working on getting the cesium-sensors plugin integrated with my project because I am working with a lot of radars and want to use this to visualize FOVs and search volumes. I was able to copy and get running the api-example for the cesium-sensors. The addRectangularSensor() function works fine now. My issue has been trying to migrate from hardcoding javascript to using czml. I’ll post the current czml I’m trying to get working. When I load it into Cesium the clock sets like you would expect, but the sensor never appears. I’m not getting any errors in the console anymore, so I’m guessing it has something to do with the formatting.

In the api example a modelMatrix is generated and added to the sensor. I know there is no modelMatrix in czml, so am I possibly missing the czml equivalent?

[

{

"id":"document",

"name":"simple",

"version":"1.0",

"clock":{

  "interval":"2014-09-08T10:00:00Z/2014-09-09T10:00:00Z",

  "currentTime":"2014-09-08T10:00:00Z",

  "multiplier":1,

  "range":"LOOP_STOP",

  "step":"SYSTEM_CLOCK_MULTIPLIER"

}

},

{

"id":"test",

"availability":"2014-09-08T10:00:00Z/2014-09-09T10:00:00Z",

"agi_rectangularSensor":{

    "show" : true,

    "xHalfAngle" : 40,

    "yHalfAngle" : 20,

    "radius" : 2000000,

    "showLateralSurfaces" : true,

    "lateralSurfaceMaterial":{

        "solidColor":{

            "color":{

                "rgba":[

                    255, 0, 0, 255

                    ]

                }

            }

        }

    },

"position": {

   "cartesian": [

        -2373754.663701, -4665332.880136, 3628133.689242

        ]

    }

}

]

``

Best,
Chris

Chris,

First, what you’re looking for to replace modelMatrix is orientation which will let you set the direction the sensor is pointing. Second, you need to specify the half-angles in radians. Lastly, the position you’ve provided seems to be about 2 km below the surface of the earth.

Here’s your example with those changes.

[

{

"id":"document",

"name":"simple",

"version":"1.0",

"clock":{

  "interval":"2014-09-08T10:00:00Z/2014-09-09T10:00:00Z",

  "currentTime":"2014-09-08T10:00:00Z",

  "multiplier":1,

  "range":"LOOP_STOP",

  "step":"SYSTEM_CLOCK_MULTIPLIER"

}

},

{

"id":"test",

“availability”:“2014-09-08T10:00:00Z/2014-09-09T10:00:00Z”,

"agi_rectangularSensor":{

    "show" : true,

    "xHalfAngle" : 0.6981317,

    "yHalfAngle" : 0.34906585,

    "radius" : 2000000,

    "showLateralSurfaces" : true,

    "lateralSurfaceMaterial":{

        "solidColor":{

            "color":{

                "rgba":[

                    255, 0, 0, 255

                    ]

                }

            }

        }

    },

"position":{

  "cartesian":[

    -2374585.392, -4666965.577, 3629411.964

  ]

},

"orientation":{

  "unitQuaternion":[

    0.4213698294593575,-0.05478247427872321,-0.11670749996066465,0.8976779527125662

  ]

}

}

]

Hope that helps.

Scott

Scott,

Thank you for your help, the sensor czmls are making a lot more sense now. I switched the position to [14028478.6319985, -22637814.2847826, 515059.303574385], which I pulled off the lotsofsensors example so it should be a visible point. When I try to load the czml into Cesium the errors that are appearing in Firefox’s console are:

Error: WebGL: renderbufferStorage generated error INVALID_ENUM Renderbuffer.js:21

Error: WebGL: clear: incomplete framebuffer Context.js:1768

Error: WebGL: drawElements: incomplete framebuffer Context.js:1768

``

And the clear/drawElements pair repeats several times. I thought I had required and defined all the necessary files to draw sensors. Normal czml files still load fine, I’m only having trouble getting the sensors to show up. Does the czml example you corrected work in your viewers?

Thanks,

Chris

Cesium Pro 1.2 works for me in Firefox 32.0.3, Chrome 38.0.2125.104 m, and IE 11.0.9600.17280. Can you provide the following?

  • Cesium version
  • Browser version
  • Information from WebGLReport.com
  • Operating system
  • Video card information
    Scott

Cesium Version: 1.1
Browser Version: Firefox 33.0, Chrome 38.0.2125.104 m, IE 11.0.9600.17358

WebGLReport.com: Firefox says it supports webgl but it is disabled or unavailable.

Chrome appears to pass everything.

IE appears to pass as well, but slight differences from Chrome such as no ANGLE or antialiasing support.

OS: Windows 7 Professional, Service Pack 1, with all current windows updates applied.

Video Card: Mobile Intel® 4 Series Express Chipset Family. Should be the integrated graphics that comes with a Core 2 Duo P8600.

Chris

I was just able to figure out how to make it work. My problem ended up being my call to the initialize() function cesium-sensors source folder. For some reason my code wasn’t reaching it, so the CzmlDataSource was never getting support for the sensors. Not sure why this was, but I moved it to the top of my CesiumViewer.js file and now czml files with sensor formatting are showing up. Thanks again for your help!

Chris

Scott,

How do you determine the orientation from the Cartesian position? I have had no luck trying to figure this out.

Thanks,
Nick