Skip to content

Commit

Permalink
Fixed normal calculation on edges
Browse files Browse the repository at this point in the history
  • Loading branch information
Bc. Jan Kaláb committed Apr 21, 2012
1 parent 288ac07 commit 59f8edc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/extras/ImageUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ THREE.ImageUtils = {

for ( var x = 0; x < width; x ++ ) {

for ( var y = 1; y < height; y ++ ) {
for ( var y = 0; y < height; y ++ ) {

var ly = y - 1 < 0 ? height - 1 : y - 1;
var uy = ( y + 1 ) % height;
var lx = x - 1 < 0 ? width - 1 : x - 1;
var ux = ( x + 1 ) % width;
var ly = y - 1 < 0 ? 0 : y - 1;
var uy = y + 1 > height - 1 ? height - 1 : y + 1;
var lx = x - 1 < 0 ? 0 : x - 1;
var ux = x + 1 > width - 1 ? width - 1 : x + 1;

var points = [];
var origin = [ 0, 0, data[ ( y * width + x ) * 4 ] / 255 * depth ];
Expand Down

0 comments on commit 59f8edc

Please sign in to comment.