Skip to content

Commit e0d4222

Browse files
committed
Merge branch 'master' of github.com:mikolalysenko/normals
2 parents 3c99aa8 + a1af21b commit e0d4222

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@ Example
1212
=======
1313
Here is how to compute the vertex and face normals for the Stanford bunny:
1414

15+
```js
1516
var bunny = require("bunny");
16-
var bunny.vertexNormals = require("normals").vertexNormals(bunny.positions, bunny.faces);
17-
var bunny.faceNormals = require("normals").faceNormals(bunny.positions, bunny.faces);
17+
bunny.vertexNormals = require("normals").vertexNormals(bunny.cells, bunny.positions);
18+
bunny.faceNormals = require("normals").faceNormals(bunny.cells, bunny.positions);
19+
```
1820

1921
`require("normals").vertexNormals(cells, positions)`
2022
----------------------------------------------------
2123
This estimates the vertex normals for an oriented mesh.
2224

25+
* `cells` is an array of indexed vertex positions
2326
* `positions` is an array of vertex positions
24-
* `faces` is an array of indexed vertex positions
2527

2628
Returns: An array of length = `positions.length` of the per-vertex normals.
2729

@@ -30,12 +32,12 @@ Returns: An array of length = `positions.length` of the per-vertex normals.
3032
----------------------------------------------------
3133
This estimates the face normals for an oriented mesh.
3234

35+
* `cells` is an array of indexed vertex positions
3336
* `positions` is an array of vertex positions
34-
* `faces` is an array of indexed vertex positions
3537

36-
Returns: An array of length = `faces.length` of the per-face normals.
38+
Returns: An array of length = `cells.length` of the per-face normals.
3739

3840

3941
Credits
4042
=======
41-
(c) 2013 Mikola Lysenko. BSD
43+
(c) 2013 Mikola Lysenko. BSD

0 commit comments

Comments
 (0)