You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
409 B
15 lines
409 B
function _to_3_elems_translation_vect(v) =
|
|
let(leng = len(v))
|
|
leng == 3 ? v :
|
|
leng == 2 ? [each v, 0] : [v.x, 0, 0];
|
|
|
|
function _to_translation_vect(v) = is_num(v) ? [v, 0, 0] : _to_3_elems_translation_vect(v);
|
|
|
|
function _m_translation_impl(v) =
|
|
let(vt = _to_translation_vect(v))
|
|
[
|
|
[1, 0, 0, vt.x],
|
|
[0, 1, 0, vt.y],
|
|
[0, 0, 1, vt.z],
|
|
[0, 0, 0, 1]
|
|
];
|