(v)
| 76 | |
| 77 | // normal of the projected quad (corners 0,1,3) — should face the camera |
| 78 | const quadNormal = (v) => { |
| 79 | const e1 = new Vector3d( |
| 80 | v[3] - v[0], |
| 81 | v[4] - v[1], |
| 82 | v[5] - v[2], // corner1 - corner0 |
| 83 | ); |
| 84 | const e2 = new Vector3d( |
| 85 | v[9] - v[0], |
| 86 | v[10] - v[1], |
| 87 | v[11] - v[2], // corner3 - corner0 |
| 88 | ); |
| 89 | return e1.cross(e2).normalize(); |
| 90 | }; |
| 91 | |
| 92 | it("spherical: the quad normal is parallel to the camera forward axis", () => { |
| 93 | const cam = new Camera3d(0, 0, 64, 64); |
no test coverage detected