Free Form Polygons

As far as I can tell, there is no current way to create a polygon with vertices of different height. Is that correct? One of the integral parts of the project I am working on requires the drawing of planes that aren’t perfectly parallel or perpendicular to the earth, which the polygon and wall geometries seem to be.
Thanks,
Eric

I should also clarify that all of my vertices will be on the same plane. I just want to create a plane from four vertices.

Keep an eye on https://github.com/AnalyticalGraphicsInc/cesium/issues/1242

This is also needed for the in-progress KML support.

Eric,

You can create a simple custom geometry for this. See Part II of the draft tutorials on Geometry and Appearances.

https://github.com/AnalyticalGraphicsInc/cesium/wiki/Geometry-and-Appearances

Patrick

Patrick,
Just wanted to give a plug for the Geometry and Appearances API, it was very easy to use and the blog tutorial was great!

I noticed in the Geometry and Appearances Sandcastle demo some translucency rendering issues on one of the extruded polygons. I set translucent : true and closed : false on lines 585-586 and the teal colored extruded polygon and it doesn’t look right, especially if I zoom in on it. I’m experiencing the same thing with one of my custom geometries, can anyone enlighten me as to what I’m seeing? Maybe I’m using the PerInstanceColorAppearance incorrectly.

Thanks,

Eric

Update:

I was using the PerInstanceColorAppearance incorrectly for what I was trying to do. I’ve now set closed : true, and changed the alpha on my ColorGeometryInstanceAttribute, and it looks much better. However I still get a weird artifact when zoom in close and move around the custom geometry. Unfortunately I’m restricted from inserting an image, but here’s an upload of the image on photobucket: Image. Any thoughts?

Thanks,

Eric

Eric,

That is a known issue. For more details than most people will care for, see: http://cesium.agi.com/massiveworlds/index.html#UsingMultipleFrustumsforMassiveWorlds

We may have some stuff in the pipeline to minimize this, but eliminating it in the general case is hard.

Patrick

Thanks for the link Patrick, that was an interesting read. I was wondering why this only occurs with translucent primitives, now I know. I hope your stenciling idea works.

I’ve changed my farToNearRatio to 10,000 with much success for my specific needs, can you tell me what kind of trade-offs I may encounter as a result? I’ve been testing translucent custom volumes near to the earth and far away, I really only see the frustum overlap artifacts very briefly when entering (zooming) into the volume or with incredibly (unrealistically) large volumes. I’m not using terrain or imagery on this project.

Thanks,

Eric

Eric,

I’m glad you enjoyed the slides.

When you increase the far-to-near ratio, you increase your chances of z-fighting, i.e., flickering artifacts. 1,000 is considered a reasonable ratio for a 24-bit fixed-point depth-buffer, which is what all desktops have today. Some mobile devices only have 16-bit depth-buffers, but we haven’t observed problems. When the ratio increases, you are most likely to see z-fighting in the distance when the triangle separation is small, e.g., a 1-meter box in the distance is going to z-fight more than a 100-meter box because the triangles are closer together and “fight” for the same fixed-point z-value. So this is fairly app-specific, and if your testing shows 10,000 is OK, then it is.

You may enjoy turning on “scene.debugShowFrustums = true;” to see the frustums colored like the images in the end of the slides.

Also, as part of the 3D models work, we are going to try to minimize this artifact since it is noticeable on windows of airplanes, for example.

Finally, if you can get permission, we’re happy to showcase your app on the Cesium website when it is ready.

Patrick