MCPcopy Create free account
hub / github.com/elftausend/graplot / draw_back_grid

Function draw_back_grid

src/render/plot3d.rs:347–361  ·  view source on GitHub ↗
(slices: u32, spacing_x: f32, spacing_z: f32)

Source from the content-addressed store, hash-verified

345}
346
347pub fn draw_back_grid(slices: u32, spacing_x: f32, spacing_z: f32) {
348 let half_slices = (slices as i32) / 2;
349 for i in -half_slices..=half_slices {
350 draw_line_3d(
351 vec3(half_slices as f32 * spacing_x, (i+half_slices) as f32 * spacing_x, -half_slices as f32 * spacing_z),
352 vec3(half_slices as f32 * spacing_x, (i+half_slices) as f32 * spacing_x, half_slices as f32* spacing_z),
353 LIGHTGRAY
354 );
355 draw_line_3d(
356 vec3(half_slices as f32 * spacing_x, 0., i as f32 * spacing_z),
357 vec3(half_slices as f32 * spacing_x, slices as f32 * spacing_x, i as f32 * spacing_z),
358 LIGHTGRAY
359 );
360 }
361}

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected