Polygons with vertices that have different heights

Hi all,

Has anyone succeed making polygons with each vertices have a different height?

The reason why is I have a surface layer model that needs to be overlay on top of the Cesium globe. I got the lat lon and the height data for each vertices, but I am only able to make flat polygons using lat lon and the height is ignored by Cesium.

I assume that this feature hasn't been supported yet. Is this feature going to be supported in the comming version b22 in November?

Or has anyone give me an example of creating a custom model in Cesium?

Thank you.

Dave

Hi Dave,

A related issue is being discussed here: https://github.com/AnalyticalGraphicsInc/cesium/issues/1242

For creating a custom geometry, which would do the trick in this case, see Part 2 of these draft tutorials: https://github.com/AnalyticalGraphicsInc/cesium/wiki/Geometry-and-Appearances

Regards,

Patrick

Hi Patrick,

Thank you for pointing out a direction for me, I'll soon test it and see how it goes.

Thank you.

Regards,
Dave

Hi all,

Now I've successfully created a custom geometry. However, I still have a problem.

The thing is my data is in the typical lat lon and height format. As a result, the custom model that was displayed looks like a long straight rectangle (because the lat lon values), which is definitely incorrect.

My question is how am I going to create the 3D model using the lat lon height data?

Thank you
Dave

Hi all,

Looks like I have solved the problem myself by using:

1. Converting lat lons into cartesian coordinate:
ellipsoid.cartographicToCartesian(Cesium.Cartographic.fromDegrees(lon, lat, height);

2. Put all the lat lon heights into a Float64Array

3. Put all the indices into a Uint16Array

4. Create a geometry likewise the given example in the documentation:
http://cesium.agi.com/Cesium/Build/Documentation/Geometry.html?classFilter=&show=all

5. Create a geometry instance to contain the geometry.

6. Add the geometry instance into the primitive.