Constructing a &[[f32; 4]; 4]

I’m still a bit confused by &[f32; N] notation. In the above, how do I construct something that looks like

[
  [ 1, 0, 0, 0]
  [ 0, 1, 0, 0]
  [0, 0, 1, 0]
  [0, 0, 0, 1]
]
    let x = [[1, 0, 0, 0], 
             [0, 1, 0, 0], 
             [0, 0, 1, 0], 
             [0, 0, 0, 1]];
1 Like

Your problem is, that 1 is not a f32, but instead an {integer}. If you write 1.0 and 0.0 everything will be fine.

3 Likes

Resolved. Thanks everyone!