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


#1

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]
]

#2
    let x = [[1, 0, 0, 0], 
             [0, 1, 0, 0], 
             [0, 0, 1, 0], 
             [0, 0, 0, 1]];

#3

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.


#4

Resolved. Thanks everyone!