Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikolalysenko/find-basis-3d
Finds an orthonormal basis with one vector parallel to a given vector
https://github.com/mikolalysenko/find-basis-3d
Last synced: about 2 months ago
JSON representation
Finds an orthonormal basis with one vector parallel to a given vector
- Host: GitHub
- URL: https://github.com/mikolalysenko/find-basis-3d
- Owner: mikolalysenko
- License: mit
- Created: 2013-10-10T05:47:48.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-06-19T17:05:15.000Z (over 10 years ago)
- Last Synced: 2024-10-10T21:41:04.756Z (3 months ago)
- Language: JavaScript
- Size: 117 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
find-basis-3d
=============
Given a single "up" vector, finds a triple of orthogonal basis vectors such that the first two are orthogonal to the last, which is parallel to the input vector. This can be used to assign tangent spaces to flat planes.## Install
npm install find-basis-3d
## Example
```javascript
var findBasis = require("find-basis-3d")var normal = [1, 0.5, 0]
console.log(findBasis(normal))
```### `require("find-basis-3d")(up)`
Finds an orthonormal basis aligned along `up`.* `up` is the z-vector for the new basis
**Returns** An array of 3 vectors, where the first two vectors are orthogonal to `up`, and the last is parallel. All vectors are orthonormal.
## Credits
(c) 2013 Mikola Lysenko. MIT License