Results 1 to 10 of 24

Thread: image processing basics

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default

    slope mapping:

    i haven't implemented this yet, only verified that it is effective:

    take the four adjacent pixels, to each side and vertically, and take the differences (or 'delta' as i believe mathematicians like to call it), eg.

    dX = n[x+1][y] - n[x-1][y];
    dY = n[x][y+1] - n[x][y-1];

    arctan2 (whatever that is..) the two arguments:
    atan(dY, dX);

    ..and you'll get something with a sign and up to +/- 2*pi which can conveniently be applied to a sin() function eg. for directionally lighting/shadowing each pixel, and adding an appropriately scaled constant allows modification of the direction.
    Last edited by xoxos; 04-13-2012 at 06:30 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •