Skip to content
This repository has been archived by the owner on Jul 31, 2022. It is now read-only.

XKT Format V7 #7

Closed
xeolabs opened this issue Feb 9, 2021 · 0 comments
Closed

XKT Format V7 #7

xeolabs opened this issue Feb 9, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@xeolabs
Copy link
Member

xeolabs commented Feb 9, 2021

The next version of the XKT file format.

Improved Geometry Reuse

XKT V7 reuses geometry data in a more flexible and granular way, resulting in smaller file sizes.

In XKT V6, the file structure is as shown below:

XKTTile(aabb)
    -> XKTEntity(id, matrix) 
        -> XKTPrimitiveInstance() 
            -> XKTPrimitive(positions, normals, indices, edgeIndices, color, opacity)

An XKTPrimitive is a triangle mesh, that has a color and an opacity. XKTPrimitives are used by XKTEntities, which each have a transform matrix. XKTTiles spatially group XKTEntitys.

This is wasteful, because in practice we often have multiple differently-colored XKTPrimitives that have the same shape, eg. a box. In that case, it means we would need to redundantly repeat that box-shaped geometry data, in order to have an object composed of differently-colored boxes.

This also means that, since an XKTEntity transforms all its XKTMeshes using the same matrix, the Local-space positions of those XKTMeshes must be nicely positioned relative to each other, ready to transform as a unit, via that matrix, into World-space.

In XKT V7, we fix this wastage like so:

  • Replace XKTPrimitive with XKTGeometry, which just holds geometry arrays (and a new primitive type property) ,
  • Introduce XKTMesh, which represents an instance of an XKTGeometry, with its own transform matrix, color and opacity
  • Remove the transform matrix from XKTEntity (since each XKTMesh has its own matrix)
XKTTile(aabb)
    -> XKTEntity(id) 
        -> XKTMesh(matrix, color, opacity) 
            -> XKTGeometry(type, positions, normals, indices, edgeIndices)

New Geometry Types

Support three geometry types: "triangles", "lines" and "points"

TODO: describe

Auto-flagging watertight geometries

TODO: describe

xeolabs added a commit that referenced this issue Feb 9, 2021
@xeolabs xeolabs added the enhancement New feature or request label Feb 9, 2021
@xeolabs xeolabs self-assigned this Feb 9, 2021
@xeolabs xeolabs pinned this issue Feb 9, 2021
@xeolabs xeolabs changed the title XKT V7 XKT Format V7 Feb 9, 2021
xeolabs added a commit that referenced this issue Mar 5, 2021
xeolabs added a commit that referenced this issue Mar 5, 2021
xeolabs added a commit that referenced this issue Mar 7, 2021
xeolabs added a commit that referenced this issue Mar 9, 2021
xeolabs added a commit that referenced this issue Mar 9, 2021
xeolabs added a commit that referenced this issue Mar 9, 2021
xeolabs added a commit that referenced this issue Mar 9, 2021
xeolabs added a commit that referenced this issue Mar 9, 2021
xeolabs added a commit that referenced this issue Mar 11, 2021
xeolabs added a commit that referenced this issue Mar 11, 2021
xeolabs added a commit that referenced this issue Mar 11, 2021
xeolabs added a commit that referenced this issue Mar 12, 2021
xeolabs added a commit that referenced this issue Mar 12, 2021
xeolabs added a commit that referenced this issue Mar 12, 2021
@xeolabs xeolabs closed this as completed May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant