Skip to main content

write_obj

Function write_obj 

Source
pub fn write_obj(
    positions: &[[f32; 3]],
    normals: &[[f32; 3]],
    indices: &[u32],
) -> String
Expand description

Write a triangle mesh as a Wavefront OBJ string.

Produces v lines for positions, vn lines for normals, and f lines using the v//vn format (1-indexed). Indices are interpreted as flat per-vertex data (index i -> positions[i] and normals[i]).