Files

18 lines
537 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# bariskeser_skills.js — lookBasis() (satır 437)
[← bariskeser_skills.js](index.md) · [← Master](../../wiki.md)
```javascript
function lookBasis(look) {
var lx = look.x, ly = look.y, lz = look.z;
var hor = Math.sqrt(lx * lx + lz * lz);
var rx, rz;
if (hor < 0.001) { rx = 1; rz = 0; }
else { rx = lz / hor; rz = -lx / hor; }
var ux = ly * rz;
var uy = lz * rx - lx * rz;
var uz = -ly * rx;
return { lx: lx, ly: ly, lz: lz, rx: rx, rz: rz, ux: ux, uy: uy, uz: uz };
}
```