https://github.com/mikolalysenko/box-frustum
  
  
    A function to test if an axis aligned bounding box interesects the camera frustum. 
    https://github.com/mikolalysenko/box-frustum
  
        Last synced: 8 months ago 
        JSON representation
    
A function to test if an axis aligned bounding box interesects the camera frustum.
- Host: GitHub
- URL: https://github.com/mikolalysenko/box-frustum
- Owner: mikolalysenko
- Created: 2013-02-09T19:47:07.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-02-09T20:20:43.000Z (over 12 years ago)
- Last Synced: 2025-03-16T20:51:15.565Z (8 months ago)
- Language: JavaScript
- Size: 109 KB
- Stars: 10
- Watchers: 3
- Forks: 1
- Open Issues: 0
- 
            Metadata Files:
            - Readme: README.md
 
Awesome Lists containing this project
README
          box-frustum
===========
A function to test if an axis aligned bounding box interesects the camera frustum.
Usage/Installation
==================
First, pull this in via npm:
    npm install box-frustum
    
Then you can do a frustum test like this:
    require("box-frustum")(
      [1, 0, 0, 0,
       0, 1, 0, 0,
       0, 0, 1, 0,
       0, 0, 0, 1],
      [[-1,-1,-1], [1,1,1]])
      
Which will check if axis-aligned bounding box from (-1,-1,-1) to (1,1,1) intersects the frustum for the unit matrix.
`require("box-frustum")(m, box)`
--------------------------------
module.exports implements the frustum test. It takes two arguments:
* `m` is an array of 16 float values representing the homogeneous clip coordinate matrix for the camera in row major order.
* `box = [lo, hi]` is an array of two length 3 arrays giving the bounds for the axis aligned bounding.
Results: true if the box intersects the camera frustum, flase otherwise.
Credits
=======
(c) 2013 Mikola Lysenko. BSD