Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion documentation/docfx_project/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,32 @@
"_site/**"
]
},
{
"src": "../docs/MeshGeneration/Factories",
"dest": "docs/MeshGeneration/Factories",
"files": [
"*.md",
"*.yml",
"toc.yml"
],
"exclude": [
"obj/**",
"_site/**"
]
},
{
"src": "../docs/MeshGeneration/Factories/Modifiers",
"dest": "docs/MeshGeneration/Factories/Modifiers",
"files": [
"*.md",
"*.yml",
"toc.yml"
],
"exclude": [
"obj/**",
"_site/**"
]
},
{ //put docfx_project/toc.yml into _site root to get navigation bar on top
"files": ["toc.yml"]
}
Expand All @@ -89,7 +115,8 @@
"src": "../docs/",
"dest": "docs",
"files": [
"images/**"
"images/**",
"MeshGeneration/Factories/Images/**"
],
"exclude": [
"obj/**",
Expand Down
27 changes: 27 additions & 0 deletions documentation/docs/06-map-factory-framework.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Map Factory Framework

This framework allows you to create and style your maps through factory and visualization abstractions. The system is intended to be designer-friendly by serializing configuration settings in `ScriptableObjects`.

## Map Controller

Not a part of the Map Visualization structure but respresents the rest of the application and requests tiles from Map Visualization.

## Map Visualization

Core class of the visualization tree, keeps and manages the factories.

###Factories

Factories are wrappers around Mapbox Api end points like raster image or vector data.

####[Terrain Factory](MeshGeneration/Factories/TerrainFactory.md)

Factory responsible for creating the world base.

####[Map Image Factory](MeshGeneration/Factories/MapImageFactory.md)

Factory responsible for assigning materials and textures to the world base mesh.

####[Mesh Factory](MeshGeneration/Factories/MeshFactory.md)

Factory responsible for the visualization of vector data.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Map Image Factory

Factory responsible for assigning materials and textures to the world base mesh.
59 changes: 59 additions & 0 deletions documentation/docs/MeshGeneration/Factories/MeshFactory.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Mesh Factory

Factory responsible for the visualization of vector data.

##Layer Visualizers

####[Vector Layer Visualizer](VectorLayerVisualizer.md)

Creates visualization for polygon and line features in 3D space.

####[Poi Layer Visualizer](PoiLayerVisualizer.md)

Creates visualization for point features in 2D/3D space.

##Modifier Stacks

####[Modifier Stack](Modifiers/ModifierStack.md)

Modifier stacks are pretty much styles for features. Stacks keep mesh & gameobject modifiers and run them on feature objects. This is the actual process creating visuals for features.


####[Merged Modifier Stack](Modifiers/MergedModifierStack.md)

Works just like regular stacks but merges the mesh outputs.

##Modifiers


###Mesh Modifiers

Mesh Modifiers creates the data, like vertices, triangles, normals and UVs, to build meshes.

####[Chamfer Modifier](Modifiers/ChamferModifier.md)

Bevels corners and adds another vertex&line to craete a smoother corner. Work only with Polygon Mesh Modifier and used to create smooth building meshes.

####[Polygon Mesh Modifier](Modifiers/PolygonMeshModifier.md)

Creates polygon from a vertices of a polygon feature. Main used for creating building footprint, landuse, water etc meshes.

####[Line Mesh Modifier](Modifiers/LineMeshModifier.md)

Creates polygons from a vertices of a line feature. Mainly used for creating road, border, contour line meshes.

####[Height Modifier](Modifiers/HeightModifier.md)

Pushes a polygon up depending on the features height value and creates side walls down to features minimum height value or ground.

####[UV Modifier](Modifiers/UvModifier.md)

Creates UV map values for polygons. Works with Polygon Mesh Modifier.

###Game Object Modifiers

Game Object Modifiers works on and modifies an already existing game object with a mesh.

####[Texture Modifier](Modifiers/TextureModifier.md)

Changes the given game object's material.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#Chamfer Modifier

Bevels corners and adds another vertex&line to craete a smoother corner. Work only with Polygon Mesh Modifier and used to create smooth building meshes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#Height Modifier

Pushes a polygon up depending on the features height value and creates side walls down to features minimum height value or ground.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#Line Mesh Modifier

Creates polygons from a vertices of a line feature. Mainly used for creating road, border, contour line meshes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#Merged Modifier Stack

Works just like regular stacks but merges the mesh outputs.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#Modifier Stack

Modifier stacks are pretty much styles for features. Stacks keep mesh & gameobject modifiers and run them on feature objects. This is the actual process creating visuals for features.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#Polygon Mesh Modifier

Creates polygon from a vertices of a polygon feature. Main used for creating building footprint, landuse, water etc meshes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#Texture Modifier

Creates UV map values for polygons. Works with Polygon Mesh Modifier.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#UV Modifier

Creates UV map values for polygons. Works with Polygon Mesh Modifier.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#Poi Layer Visualizer

Creates visualization for point features in 2D/3D space.
49 changes: 49 additions & 0 deletions documentation/docs/MeshGeneration/Factories/TerrainFactory.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Terrain Factory

Terrain Factory creates the world base mesh. It's able to create flat terrain, real height terrain or modified terrain where real height is multiplied by a factor.

####Parameters

**Map Type**: Flat, Height or Modified Height.

**Map ID Type**: Data source used in the *Height* and *Modified Height* map types. Default value is "mapbox.terrain-rgb".

**Height Multiplier**: Used in *Modified Height* map type as a simple multiplier on queried terrain height.

**Resolution**: Terrain is generated as a grid mesh and resolution represents the sample count on each edge of this grid.

**Material**: Base material for the generated mesh. Will most likely be overridden by MapImageFactory but useful if you're not using it.

**Update**: Update function recreates the terrain using current parameters.

####Methods

Terrain factory has three public methods; `Initialize`, `Register` and `Update` coming from the base `Factory` class.

`Initialize` method clears and reinitalizes the registered tile list. Can be used as a reset method.

`Register` method adds new tiles to the registered tiles list to be processed.

`Update` method clears the mesh data for all tiles and recraetes them using current settings. Clearing the mesh data first is important for stitching tile edges to each other.


Private method `Run` starts the processing of a tile and directs tile to different functions depending on the `Map Type` parameter. These methods can be extracted into external modules in the future.

`CreateTerrainHeight` fetches the data from the Mapbox server and passes it to `GenerateTerrainMesh` for mesh generation, which creates a grid and queries the data for height of each node in this grid. Mesh vertices, triangles, normals and UV map are all created and set in this function.

`FixStitches` method stitches the edges of terrain tiles to make it look continuous and smooth.

`CreateFlatMesh` creates a quad as base mesh and doesn't use resolution.


##Flat Terrain

![flat terrain](images/flatterrain.png)

##Real Height

![real height terrain](images/realheight.png)

##Modified Terrain Height

![modified terrain](images/modifiedterrain.png)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#Vector Layer Visualizer

Creates visualization for polygon and line features in 3D space.
3 changes: 3 additions & 0 deletions documentation/docs/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@
- name: Changelog
href: 05-changelog.md

- name: Map Factory Framework
href: 06-map-factory-framework.md

- name: HoloLens Development
href: hololens-development.md