You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the SharpGLTF.Ext.3DTiles extension with Cesium and am able to build them and display them in Cesium reading values out of the property tables using conditions on the Cesium3DTileStyle.
This is how I'm building them following examples from this repo.
` var scene = new SceneBuilder("scene");
// mesh contains the vertices/triangles with a custom property vertex and Feature Id
scene.AddRigidMesh(mesh, transform);
var model = scene.ToGltf2();
var rootMetadata = model.UseStructuralMetadata();
var schema = rootMetadata.UseEmbeddedSchema("Schema");
var metadataClass = schema.UseClassMetadata("ClassMetadata");
// Values is a list of doubles
var propertyTable = metadataClass.AddPropertyTable(values.Length, "Property Table");
var heightMetaDataProperty = metadataClass.UseProperty("Value").WithFloat64Type();
propertyTable.UseProperty(heightMetaDataProperty).SetValues(propertyMaps.Heights);
var featureIdAttribute = new FeatureIDBuilder(values.Length, 0, propertyTable);
model.LogicalMeshes[0].Primitives[0].AddMeshFeatureIds(featureIdAttribute);`
But what I want to do now is read those values back out of the GLTF property table so I can update the model based on some user input and push it back to the cesium web client.
Based on 'src/SharpGLTF.Ext.3DTiles/README.md' and reading through unit tests I can read the feature Ids and access the StructuralMetadataClass and schema from the vertices but cannot find a way to get the "Value" array of doubles(/Float64s) from the property tables.
Have I missed something obvious? Is this possible?
The text was updated successfully, but these errors were encountered:
So at the moment reading the values of the property tables back is not supported. Support can be added but it's some work to get right for all data types.
I'm using the SharpGLTF.Ext.3DTiles extension with Cesium and am able to build them and display them in Cesium reading values out of the property tables using conditions on the Cesium3DTileStyle.
This is how I'm building them following examples from this repo.
` var scene = new SceneBuilder("scene");
// mesh contains the vertices/triangles with a custom property vertex and Feature Id
scene.AddRigidMesh(mesh, transform);
var model = scene.ToGltf2();
var rootMetadata = model.UseStructuralMetadata();
var schema = rootMetadata.UseEmbeddedSchema("Schema");
var metadataClass = schema.UseClassMetadata("ClassMetadata");
// Values is a list of doubles
var propertyTable = metadataClass.AddPropertyTable(values.Length, "Property Table");
var heightMetaDataProperty = metadataClass.UseProperty("Value").WithFloat64Type();
propertyTable.UseProperty(heightMetaDataProperty).SetValues(propertyMaps.Heights);
var featureIdAttribute = new FeatureIDBuilder(values.Length, 0, propertyTable);
model.LogicalMeshes[0].Primitives[0].AddMeshFeatureIds(featureIdAttribute);`
But what I want to do now is read those values back out of the GLTF property table so I can update the model based on some user input and push it back to the cesium web client.
Based on 'src/SharpGLTF.Ext.3DTiles/README.md' and reading through unit tests I can read the feature Ids and access the StructuralMetadataClass and schema from the vertices but cannot find a way to get the "Value" array of doubles(/Float64s) from the property tables.
Have I missed something obvious? Is this possible?
The text was updated successfully, but these errors were encountered: