Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cityjson
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WANDER
cityjson
Commits
0e2ea12d
Commit
0e2ea12d
authored
2 years ago
by
Knuiman, Bart
Browse files
Options
Downloads
Patches
Plain Diff
readme update
parent
3704f5f5
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+17
-1
17 additions, 1 deletion
README.md
README.md.backup
+17
-1
17 additions, 1 deletion
README.md.backup
Runtime/CityJson.cs
+1
-1
1 addition, 1 deletion
Runtime/CityJson.cs
package.json
+1
-1
1 addition, 1 deletion
package.json
with
36 additions
and
4 deletions
README.md
+
17
−
1
View file @
0e2ea12d
## CityJson
Loads a cityjson (
*.json or *
.city.json) file and provides acces to its
vertices, appearance.
vertices, appearance
, materials, etc
.
### No dependencies to Unity!
-
This can se used in any C# project.
...
...
@@ -21,6 +21,22 @@ cj.Materials
// Vertices
var unityVertices = cj.Vertices.Select( v => new Vector3(v.x, v.z, v.y) ).ToArray();
for (int i=0; i<cj.CityObjects.Count;i++ )
{
var geom = cj.CityObjects[i].geometry;
Mesh m = new Mesh();
m.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32;
m.subMeshCount = geom.indices.Count;
m.SetVertices( unityVertices );
for ( int j=0; j<geom.indices.Count; j++)
{
m.SetTriangles( geom.indices[j], j );
}
m.RecalculateNormals();
m.Optimize();
m.UploadMeshData( true );
}
```
### Important:
...
...
This diff is collapsed.
Click to expand it.
README.md.backup
+
17
−
1
View file @
0e2ea12d
...
...
@@ -19,7 +19,23 @@ cj.Geometries
cj.Materials
// Vertices
var unityVertices = cj.Vertices.Select( v => new Vector3(v.x, v.z, v.y) ).ToArra
var unityVertices = cj.Vertices.Select( v => new Vector3(v.x, v.z, v.y) ).ToArray();
for (int i=0; i<cj.CityObjects.Count;i++ )
{
var geom = cj.CityObjects[i].geometry;
Mesh m = new Mesh();
m.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32;
m.subMeshCount = geom.indices.Count;
m.SetVertices( unityVertices );
for ( int j=0; j<geom.indices.Count; j++)
{
m.SetTriangles( geom.indices[j], j );
}
m.RecalculateNormals();
m.Optimize();
m.UploadMeshData( true );
}
```
...
...
This diff is collapsed.
Click to expand it.
Runtime/CityJson.cs
+
1
−
1
View file @
0e2ea12d
...
...
@@ -61,7 +61,6 @@ namespace Wander
List
<
int
>
geometryIndices
=
new
List
<
int
>();
// Output
string
path
;
string
title
;
string
crs
;
string
referenceDate
;
...
...
@@ -76,6 +75,7 @@ namespace Wander
Dictionary
<
string
,
int
>
errors
=
new
Dictionary
<
string
,
int
>();
// Output properties
public
string
Title
=>
title
;
public
Dictionary
<
string
,
long
>
Timings
=>
timings
;
public
Dictionary
<
string
,
int
>
Errors
=>
errors
;
public
List
<(
long
x
,
long
y
,
long
z
)>
Vertices
=>
vertices
;
...
...
This diff is collapsed.
Click to expand it.
package.json
+
1
−
1
View file @
0e2ea12d
{
"name"
:
"com.wurwander.cityjson"
,
"version"
:
"1.0.
0
"
,
"version"
:
"1.0.
1
"
,
"displayName"
:
"CityJson"
,
"description"
:
"Provides a way to load CityJson and generate geometries with materials for direct engine use (Unity, Unreal). No dependencies to Unity or Unreal. Only 'System'"
,
"unity"
:
"2021.3"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment