🧩 Geometry template in Ninja cannot correctly apply or display transformationMatrix, material, and texture
📘 Background
In geographic scene modeling, objects such as trees are often represented using geometry templates to save space and resources.
According to the CityJSON 2.0.1 specification, a template object can include a material member.
Figure 1. Example from CityJSON specification showing template support for the material member.
🧪 Test Setup and Validation
1. Base Model Validation
- A single tree model with branch and trunk was created using a CityObject.
- Both
material and texture were displayed correctly in Ninja.
- The model passed
cjval validation (The file is valid).
Figure 2. cjval validation result of the base tree object.
2. Geometry Template Test
- The same tree was restructured using a geometry template for reuse.
- The model was visualized correctly, but its
transformationMatrix, material, and texture were not applied correctly.
- The data file also passed
cjval validation (The file is 100% valid!).
Figure 3. cjval validation result of the template-based file.
📁 Test Data Description
✅ TreeDemo.city.json
- A single tree model represented as a
SolitaryVegetationObject.
- Serves as the baseline for verifying correct rendering of
material and texture.
- Validated successfully using
cjval.
- Data file: TreeDemo.city.json
Figure 4. Default tree model.
Figure 5. Tree model with different materials.
Figure 6. Tree model with applied textures.
🧩 IssueDemo.city.json
- Contains two cube objects (using CityObjects) and two tree objects (using geometry templates).
- Both tree models share the same geometry template but reference different transformation indices.
- Each tree consists of a trunk and a branch component.
- Data file: IssueDemo.city.json
Figure 7. Comparison between cube (CityObject) and tree (geometry template) models.
both files use the same Texture resources:
- wood.jpg
- brick.jpg
- Trunk_MAT.jpeg
- Branch_MAT.png
⚠️ Problem Description
1. transformationMatrix not applied correctly
- In Ninja, geometry templates only display correctly with the default matrix.
- Any modification (translation, rotation, scaling) causes the object to disappear.
- Example: scaling or offsetting the trunk of the second tree makes it invisible.
"transformationMatrix": [
10.0, 0.0, 0.0, 0.0,
0.0, 10.0, 0.0, 0.0,
0.0, 0.0, 10.0, 0.0,
0.0, 0.0, 0.0, 1.0
]
Figure 8. Object disappears when a non-default transformationMatrix is applied.
2. material not displayed correctly
- Cube objects display different
materials correctly.
- Tree objects (using geometry templates) disappear when
material is assigned.
Figure 9. Cube rendered correctly, tree model disappears when material applied.
3. texture not displayed correctly
- Cube objects display textures correctly.
- Tree objects (geometry templates) show no visible texture changes.
Figure 10. Cube shows texture properly, tree model unaffected.
💡 Summary
Geometry template objects in Ninja cannot correctly apply or display:
transformationMatrix
material
texture
All tested files are 100% valid according to cjval.
❓Questions
- What might cause Ninja to fail applying these attributes (
transformationMatrix, material, texture) to geometry template objects?
- Is there a known fix, configuration, or workaround to correctly render geometry templates with these properties?
🧩 Geometry template in Ninja cannot correctly apply or display
transformationMatrix,material, andtexture📘 Background
In geographic scene modeling, objects such as trees are often represented using geometry templates to save space and resources.
According to the CityJSON 2.0.1 specification, a template object can include a
materialmember.🧪 Test Setup and Validation
1. Base Model Validation
materialandtexturewere displayed correctly in Ninja.cjvalvalidation (The file is valid).2. Geometry Template Test
transformationMatrix,material, andtexturewere not applied correctly.cjvalvalidation (The file is 100% valid!).📁 Test Data Description
✅ TreeDemo.city.json
SolitaryVegetationObject.materialandtexture.cjval.🧩 IssueDemo.city.json
both files use the same Texture resources:
1.
transformationMatrixnot applied correctly2.
materialnot displayed correctlymaterialscorrectly.materialis assigned.3.
texturenot displayed correctly💡 Summary
Geometry template objects in Ninja cannot correctly apply or display:
transformationMatrixmaterialtextureAll tested files are 100% valid according to
cjval.❓Questions
transformationMatrix,material,texture) to geometry template objects?