Skip to content

Commit 13f0905

Browse files
author
Robert Onulak
committed
Updates example scenes to latest in HTK. Fixes facing of tris when converting from room to wavefront meshes.
1 parent 822e67f commit 13f0905

File tree

5 files changed

+103
-100
lines changed

5 files changed

+103
-100
lines changed

Assets/HoloToolkit-Examples/SavingSpatialMeshes/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Process: Scan, save, download, and load.
1717
1. Install the app on a device.
1818
2. Scan room.
1919
3. When your ready to save the mesh say, "Capture Mesh". Text will display to acknowledge the completion of the action.
20-
4. Pull the saved mesh off of the device by going to the Device Portal. Navigate to System > File Explorer > User Files > LocalAppData > <Your App> > RoamingState. This is where .room files are saved.
20+
4. Pull the saved mesh off of the device by going to the Device Portal. Navigate to System > File Explorer > User Files > LocalAppData > [Your App Name] > RoamingState. This is where .room files are saved.
2121
5. Download the .room file to your computer in the location opened by FileSurfaceObserver's "Open File Location" button.
2222
6. Press the Play button.
2323
7. Click in the Game window to make sure it has focus.

Assets/HoloToolkit-Examples/SavingSpatialMeshes/SaveSpatialMapping.unity

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
%YAML 1.1
22
%TAG !u! tag:unity3d.com,2011:
33
--- !u!29 &1
4-
SceneSettings:
4+
OcclusionCullingSettings:
55
m_ObjectHideFlags: 0
6-
m_PVSData:
7-
m_PVSObjectsArray: []
8-
m_PVSPortalsArray: []
6+
serializedVersion: 2
97
m_OcclusionBakeSettings:
108
smallestOccluder: 5
119
smallestHole: 0.25
1210
backfaceThreshold: 100
11+
m_SceneGUID: 00000000000000000000000000000000
12+
m_OcclusionCullingData: {fileID: 0}
1313
--- !u!104 &2
1414
RenderSettings:
1515
m_ObjectHideFlags: 0
@@ -79,17 +79,60 @@ NavMeshSettings:
7979
m_ObjectHideFlags: 0
8080
m_BuildSettings:
8181
serializedVersion: 2
82+
agentTypeID: 0
8283
agentRadius: 0.5
8384
agentHeight: 2
8485
agentSlope: 45
8586
agentClimb: 0.4
8687
ledgeDropHeight: 0
8788
maxJumpAcrossDistance: 0
88-
accuratePlacement: 0
8989
minRegionArea: 2
90-
cellSize: 0.16666667
9190
manualCellSize: 0
91+
cellSize: 0.16666667
92+
accuratePlacement: 0
9293
m_NavMeshData: {fileID: 0}
94+
--- !u!1001 &213568931
95+
Prefab:
96+
m_ObjectHideFlags: 0
97+
serializedVersion: 2
98+
m_Modification:
99+
m_TransformParent: {fileID: 0}
100+
m_Modifications:
101+
- target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2}
102+
propertyPath: m_LocalPosition.x
103+
value: 0
104+
objectReference: {fileID: 0}
105+
- target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2}
106+
propertyPath: m_LocalPosition.y
107+
value: 0
108+
objectReference: {fileID: 0}
109+
- target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2}
110+
propertyPath: m_LocalPosition.z
111+
value: 0
112+
objectReference: {fileID: 0}
113+
- target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2}
114+
propertyPath: m_LocalRotation.x
115+
value: 0
116+
objectReference: {fileID: 0}
117+
- target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2}
118+
propertyPath: m_LocalRotation.y
119+
value: 0
120+
objectReference: {fileID: 0}
121+
- target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2}
122+
propertyPath: m_LocalRotation.z
123+
value: 0
124+
objectReference: {fileID: 0}
125+
- target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2}
126+
propertyPath: m_LocalRotation.w
127+
value: 1
128+
objectReference: {fileID: 0}
129+
- target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2}
130+
propertyPath: m_RootOrder
131+
value: 0
132+
objectReference: {fileID: 0}
133+
m_RemovedComponents: []
134+
m_ParentPrefab: {fileID: 100100000, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2}
135+
m_IsPrefabParent: 0
93136
--- !u!1001 &406582863
94137
Prefab:
95138
m_ObjectHideFlags: 0
@@ -195,48 +238,6 @@ Prefab:
195238
- {fileID: 114000012149591842, guid: 2ed75ffdf9031c94e8bce4b3d17b9928, type: 2}
196239
m_ParentPrefab: {fileID: 100100000, guid: 2ed75ffdf9031c94e8bce4b3d17b9928, type: 2}
197240
m_IsPrefabParent: 0
198-
--- !u!1001 &1806518574
199-
Prefab:
200-
m_ObjectHideFlags: 0
201-
serializedVersion: 2
202-
m_Modification:
203-
m_TransformParent: {fileID: 0}
204-
m_Modifications:
205-
- target: {fileID: 402774, guid: b84b73491ac53a34095000876132a211, type: 2}
206-
propertyPath: m_LocalPosition.x
207-
value: 0
208-
objectReference: {fileID: 0}
209-
- target: {fileID: 402774, guid: b84b73491ac53a34095000876132a211, type: 2}
210-
propertyPath: m_LocalPosition.y
211-
value: 0
212-
objectReference: {fileID: 0}
213-
- target: {fileID: 402774, guid: b84b73491ac53a34095000876132a211, type: 2}
214-
propertyPath: m_LocalPosition.z
215-
value: 0
216-
objectReference: {fileID: 0}
217-
- target: {fileID: 402774, guid: b84b73491ac53a34095000876132a211, type: 2}
218-
propertyPath: m_LocalRotation.x
219-
value: 0
220-
objectReference: {fileID: 0}
221-
- target: {fileID: 402774, guid: b84b73491ac53a34095000876132a211, type: 2}
222-
propertyPath: m_LocalRotation.y
223-
value: 0
224-
objectReference: {fileID: 0}
225-
- target: {fileID: 402774, guid: b84b73491ac53a34095000876132a211, type: 2}
226-
propertyPath: m_LocalRotation.z
227-
value: 0
228-
objectReference: {fileID: 0}
229-
- target: {fileID: 402774, guid: b84b73491ac53a34095000876132a211, type: 2}
230-
propertyPath: m_LocalRotation.w
231-
value: 1
232-
objectReference: {fileID: 0}
233-
- target: {fileID: 402774, guid: b84b73491ac53a34095000876132a211, type: 2}
234-
propertyPath: m_RootOrder
235-
value: 0
236-
objectReference: {fileID: 0}
237-
m_RemovedComponents: []
238-
m_ParentPrefab: {fileID: 100100000, guid: b84b73491ac53a34095000876132a211, type: 2}
239-
m_IsPrefabParent: 0
240241
--- !u!1 &1948556033 stripped
241242
GameObject:
242243
m_PrefabParentObject: {fileID: 1000010302963436, guid: 2ed75ffdf9031c94e8bce4b3d17b9928,

Assets/HoloToolkit-Examples/SavingSpatialMeshes/SaveSpatialUnderstanding.unity

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
%YAML 1.1
22
%TAG !u! tag:unity3d.com,2011:
33
--- !u!29 &1
4-
SceneSettings:
4+
OcclusionCullingSettings:
55
m_ObjectHideFlags: 0
6-
m_PVSData:
7-
m_PVSObjectsArray: []
8-
m_PVSPortalsArray: []
6+
serializedVersion: 2
97
m_OcclusionBakeSettings:
108
smallestOccluder: 5
119
smallestHole: 0.25
1210
backfaceThreshold: 100
11+
m_SceneGUID: 00000000000000000000000000000000
12+
m_OcclusionCullingData: {fileID: 0}
1313
--- !u!104 &2
1414
RenderSettings:
1515
m_ObjectHideFlags: 0
@@ -79,17 +79,60 @@ NavMeshSettings:
7979
m_ObjectHideFlags: 0
8080
m_BuildSettings:
8181
serializedVersion: 2
82+
agentTypeID: 0
8283
agentRadius: 0.5
8384
agentHeight: 2
8485
agentSlope: 45
8586
agentClimb: 0.4
8687
ledgeDropHeight: 0
8788
maxJumpAcrossDistance: 0
88-
accuratePlacement: 0
8989
minRegionArea: 2
90-
cellSize: 0.16666667
9190
manualCellSize: 0
91+
cellSize: 0.16666667
92+
accuratePlacement: 0
9293
m_NavMeshData: {fileID: 0}
94+
--- !u!1001 &234708315
95+
Prefab:
96+
m_ObjectHideFlags: 0
97+
serializedVersion: 2
98+
m_Modification:
99+
m_TransformParent: {fileID: 0}
100+
m_Modifications:
101+
- target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2}
102+
propertyPath: m_LocalPosition.x
103+
value: 0
104+
objectReference: {fileID: 0}
105+
- target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2}
106+
propertyPath: m_LocalPosition.y
107+
value: 0
108+
objectReference: {fileID: 0}
109+
- target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2}
110+
propertyPath: m_LocalPosition.z
111+
value: 0
112+
objectReference: {fileID: 0}
113+
- target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2}
114+
propertyPath: m_LocalRotation.x
115+
value: 0
116+
objectReference: {fileID: 0}
117+
- target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2}
118+
propertyPath: m_LocalRotation.y
119+
value: 0
120+
objectReference: {fileID: 0}
121+
- target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2}
122+
propertyPath: m_LocalRotation.z
123+
value: 0
124+
objectReference: {fileID: 0}
125+
- target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2}
126+
propertyPath: m_LocalRotation.w
127+
value: 1
128+
objectReference: {fileID: 0}
129+
- target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2}
130+
propertyPath: m_RootOrder
131+
value: 0
132+
objectReference: {fileID: 0}
133+
m_RemovedComponents: []
134+
m_ParentPrefab: {fileID: 100100000, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2}
135+
m_IsPrefabParent: 0
93136
--- !u!1001 &432392896
94137
Prefab:
95138
m_ObjectHideFlags: 0
@@ -209,48 +252,6 @@ MonoBehaviour:
209252
MeshFileName: SpatialUnderstandingMesh
210253
LoadFileKey: 108
211254
SaveFileKey: 115
212-
--- !u!1001 &883852864
213-
Prefab:
214-
m_ObjectHideFlags: 0
215-
serializedVersion: 2
216-
m_Modification:
217-
m_TransformParent: {fileID: 0}
218-
m_Modifications:
219-
- target: {fileID: 402774, guid: b84b73491ac53a34095000876132a211, type: 2}
220-
propertyPath: m_LocalPosition.x
221-
value: 0
222-
objectReference: {fileID: 0}
223-
- target: {fileID: 402774, guid: b84b73491ac53a34095000876132a211, type: 2}
224-
propertyPath: m_LocalPosition.y
225-
value: 0
226-
objectReference: {fileID: 0}
227-
- target: {fileID: 402774, guid: b84b73491ac53a34095000876132a211, type: 2}
228-
propertyPath: m_LocalPosition.z
229-
value: 0
230-
objectReference: {fileID: 0}
231-
- target: {fileID: 402774, guid: b84b73491ac53a34095000876132a211, type: 2}
232-
propertyPath: m_LocalRotation.x
233-
value: 0
234-
objectReference: {fileID: 0}
235-
- target: {fileID: 402774, guid: b84b73491ac53a34095000876132a211, type: 2}
236-
propertyPath: m_LocalRotation.y
237-
value: 0
238-
objectReference: {fileID: 0}
239-
- target: {fileID: 402774, guid: b84b73491ac53a34095000876132a211, type: 2}
240-
propertyPath: m_LocalRotation.z
241-
value: 0
242-
objectReference: {fileID: 0}
243-
- target: {fileID: 402774, guid: b84b73491ac53a34095000876132a211, type: 2}
244-
propertyPath: m_LocalRotation.w
245-
value: 1
246-
objectReference: {fileID: 0}
247-
- target: {fileID: 402774, guid: b84b73491ac53a34095000876132a211, type: 2}
248-
propertyPath: m_RootOrder
249-
value: 0
250-
objectReference: {fileID: 0}
251-
m_RemovedComponents: []
252-
m_ParentPrefab: {fileID: 100100000, guid: b84b73491ac53a34095000876132a211, type: 2}
253-
m_IsPrefabParent: 0
254255
--- !u!1001 &1425495928
255256
Prefab:
256257
m_ObjectHideFlags: 0

Assets/HoloToolkit/SpatialMapping/Scripts/RemoteMapping/Editor/RoomMeshExporter.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Text;
44
using UnityEditor;
55
using UnityEngine;
6+
using HoloToolkit.Unity.SpatialMapping;
67

78
namespace HoloToolkit.Unity
89
{
@@ -193,9 +194,9 @@ private static void SerializeMesh(Mesh mesh, TextWriter stream, ref int offset)
193194
{
194195
// Format is "vertex index / material index / normal index"
195196
stream.WriteLine(string.Format("f {0}//{0} {1}//{1} {2}//{2}",
196-
indices[i + 0] + 1 + offset,
197+
indices[i + 2] + 1 + offset,
197198
indices[i + 1] + 1 + offset,
198-
indices[i + 2] + 1 + offset));
199+
indices[i + 0] + 1 + offset));
199200
}
200201
}
201202

Assets/HoloToolkit/SpatialMapping/Scripts/RemoteMapping/SimpleMeshSerializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static class SimpleMeshSerializer
2929
/// <returns>Binary representation of the Mesh objects.</returns>
3030
public static byte[] Serialize(IEnumerable<Mesh> meshes)
3131
{
32-
byte[] data = null;
32+
byte[] data;
3333

3434
using (MemoryStream stream = new MemoryStream())
3535
{

0 commit comments

Comments
 (0)