Skip to content

Commit 553ff09

Browse files
committed
Fix add_cube
1 parent 3afcb06 commit 553ff09

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/geometryutils/render3.nim

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,12 @@ proc add_cube*(wireframe: Wireframe, pos, size: Vec3) =
272272
))
273273

274274
wireframe.lines &= [
275-
[0, 1], [2, 3], [4, 5], [6, 7],
276-
[0, 4], [2, 6], [1, 5], [3, 7],
277-
[0, 2], [4, 6], [5, 7], [1, 3]
275+
[idx + 0, idx + 1], [idx + 2, idx + 3],
276+
[idx + 4, idx + 5], [idx + 6, idx + 7],
277+
[idx + 0, idx + 4], [idx + 2, idx + 6],
278+
[idx + 1, idx + 5], [idx + 3, idx + 7],
279+
[idx + 0, idx + 2], [idx + 4, idx + 6],
280+
[idx + 5, idx + 7], [idx + 1, idx + 3]
278281
]
279282

280283
proc new_cube_wireframe*(pos, size: Vec3): Wireframe =
@@ -333,7 +336,7 @@ type
333336
ambient*: float64
334337

335338
Render3* = object
336-
window: BaseWindow
339+
window*: BaseWindow
337340

338341
shader_prog: ShaderProgram
339342
wireframe_shader_prog: ShaderProgram

src/geometryutils/serialize.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ proc load*[T](stream: Stream, items: var seq[T]) =
143143
proc load*[K, V](stream: Stream, items: var Table[K, V]) =
144144
mixin load
145145
var length: int64
146-
stream.load(length)
146+
stream.load(length)
147147
items = init_table[K, V]()
148148
for it in 0..<int(length):
149149
var

0 commit comments

Comments
 (0)