I used CoplanarPolygonGeometry to add some geometry with height, and found that some textures are normal while others are flipped. Can you solve the flipping problem? I found it on GitHub Improve CoplanarPolygonGeometry normal calculation by hpinkos · Pull Request #7188 · CesiumGS/cesium · GitHub But I still don’t know how to solve it. I want to apply textures based on the direction of the camera’s line of sight. Which part should I modify?
Hi @shengqin_guo, can you explain what you mean by “flipped”? A Sandcastle link demonstrating the problem would help us understand what you are trying to do.
Have you looked at the Polygons Sandcastle? One of the sample polygons has an extruded height, and uses a texture as the material. You can change the orientation of the texture by adjusting the textureCoordinates
property.
textureCoordinates: {
positions: [
new Cesium.Cartesian2(0, 1),
new Cesium.Cartesian2(0, 0),
new Cesium.Cartesian2(0.5, 0),
new Cesium.Cartesian2(1, 0),
new Cesium.Cartesian2(1, 1),
],
},
Here is an example Sandcastle where I rotated one of the textures to have the “top” along the South edge.