Our current Style API is mainly focused on 2D styling except for the point.model that allows to instantiate a 3D model instead of points.
Some styling options can be passed to 3D layers such as C3DTilesLayer or PointCloudLayer. For instance, we can configure the mode for point clouds (PNTS_MODE), the point size, the shape, etc.
The style is currently applied to Feature objects that are created during the convert step of itowns 2D rendering preparation pipeline. 3D layers don't go through the same pipeline.
Proposal
My proposition is to harmonize style declaration for 2D and 3D layers in our API and therefore extend the Style class to support 3D styling options.
Example
Current point style declaration for C3DTilesLayer:
var $3dTilesLayerSetePC = new itowns.ThreeDTilesLayer('3d-tiles-sete', {
name: 'SetePC',
pntsMode: itowns.PNTS_MODE.CLASSIFICATION,
pntsShape : itowns.PNTS_SHAPE.CIRCLE,
source: $3dTilesSource,
});
I chose to not separate 2d and 3d in the style configuration to avoid a breaking change and to avoid too many nested levels but it is open to discussion.
If we go along with this proposal I think we will need a table that shows which styling options are used with which layer. Another solution would be to create a specialization of the Style class for each type of layer, that would only contain the styling options specific to that layer. (e.g. C3DTilesLayerStyle, PointCloudLayerStyle, etc.). I'd rather have only one Style class with everything in it but again it is open to discussion.
Let me know what you think, if we go along with this I can start implementing it for the new ThreeDTilesLayer using 3d-tiles-renderer-js
Context
Our current
Style
API is mainly focused on 2D styling except for thepoint.model
that allows to instantiate a 3D model instead of points.Some styling options can be passed to 3D layers such as
C3DTilesLayer
orPointCloudLayer
. For instance, we can configure themode
for point clouds (PNTS_MODE
), the point size, the shape, etc.The style is currently applied to
Feature
objects that are created during the convert step of itowns 2D rendering preparation pipeline. 3D layers don't go through the same pipeline.Proposal
My proposition is to harmonize style declaration for 2D and 3D layers in our API and therefore extend the
Style
class to support 3D styling options.Example
Current point style declaration for
C3DTilesLayer
:New point style declaration for
C3DTilesLayer
:Related topics and open questions
2d
and3d
in the style configuration to avoid a breaking change and to avoid too many nested levels but it is open to discussion.Style
class for each type of layer, that would only contain the styling options specific to that layer. (e.g.C3DTilesLayerStyle
,PointCloudLayerStyle
, etc.). I'd rather have only oneStyle
class with everything in it but again it is open to discussion.Let me know what you think, if we go along with this I can start implementing it for the new
ThreeDTilesLayer
using3d-tiles-renderer-js