PB Unity
commited on
Upload RunBlazeFace.cs
Browse files- RunBlazeFace.cs +9 -10
RunBlazeFace.cs
CHANGED
@@ -180,19 +180,18 @@ public class RunBlazeFace : MonoBehaviour
|
|
180 |
{
|
181 |
var offsets = new float[896 * 4];
|
182 |
int n = 0;
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
for (int j = 0; j <
|
190 |
{
|
191 |
-
offsets[n++] =
|
192 |
-
offsets[n++] =
|
193 |
n += 2;
|
194 |
}
|
195 |
-
return offsets;
|
196 |
}
|
197 |
|
198 |
void SetupModel()
|
|
|
180 |
{
|
181 |
var offsets = new float[896 * 4];
|
182 |
int n = 0;
|
183 |
+
AddGrid(offsets, 16, 2, 8, ref n);
|
184 |
+
AddGrid(offsets, 8, 6, 16, ref n);
|
185 |
+
return offsets;
|
186 |
+
}
|
187 |
+
void AddGrid(float[] offsets, int rows, int repeats, int cellWidth, ref int n)
|
188 |
+
{
|
189 |
+
for (int j = 0; j < repeats * rows * rows; j++)
|
190 |
{
|
191 |
+
offsets[n++] = cellWidth * ((j / repeats) % rows - (rows - 1) * 0.5f);
|
192 |
+
offsets[n++] = cellWidth * ((j / repeats / rows) - (rows - 1) * 0.5f);
|
193 |
n += 2;
|
194 |
}
|
|
|
195 |
}
|
196 |
|
197 |
void SetupModel()
|