Hi,
I’m trying to create an ESRI i3s web browser using Cesium,
now I’m able to create the 3D buildings (GeometryInstance) after parsing the geometry data into vertices and normals, the screenshot below is the current status of the visualization.
codes of drawing buildings:
let geometry = new Cesium.Geometry({
attributes: {
position: new Cesium.GeometryAttribute({
componentDatatype: Cesium.ComponentDatatype.DOUBLE,
componentsPerAttribute: 3,
values: positions // vertices of buildings
}),
normal: new Cesium.GeometryAttribute({
componentDatatype: Cesium.ComponentDatatype.FLOAT,
componentsPerAttribute: 3,
values: normals // normals of buildings
})
},
primitiveType: Cesium.PrimitiveType.TRIANGLES,
boundingSphere: Cesium.BoundingSphere.fromVertices(positions)
});
var instance = new Cesium.GeometryInstance({
geometry: geometry,
attributes: {
color: Cesium.ColorGeometryInstanceAttribute.fromColor(color)
},
show: new Cesium.ShowGeometryInstanceAttribute(true)
});
The next important step is to map the image textures onto those buildings. How can I implement this? and what data/parameters should I have besides the images?
The image textures would be something like this:
The Cesium I use is v1.50, and I use Chrome browser on Windows10.
Thank you in advance!