The following function is -supposed- to move a pixel along a vector from the current point to the origin a little way.
Variables and array's and all that are fine, what the problem is, is the -equation- for moving the point.
What's supposed to happen is:
A point's X and Y distances from the origin are found, then the distance of the point directly from the origin is calculated using SQRT( DX*DX + DY*DY),
The X length and Y length are then reduced to single units by dividing DX and DY by the distance between the origin and the pixel.
Then the new distance is calulated by adding a small amount (can be negative) to the current distance.
Then the X and Y unit values are multiplied by the new distance value to find the co-ordinates of the translated pixel to be used instead of the pixel found at that point.
It should work, but the effect the following code generates produces is to move a pixel that should only move on the X direction (as the x pixel is in aline with the x origin) a little on the Y position too.
What on earth is going on? why does the pixel on the X origin's plane move on the Y too, and why does the same happen for Y?
It -must- be the equation, but I can't see what the problem is!
//Find the distance current pixel is away from origin
//Find the unit x and y values of the pixel from the origin
//Create new distance using bumpmap information as the alteration
//Move from the origin to the offset pixel
//Check the new pixel is in bounds
//Map the X,Y co-ordinates onto the array
//Store translated pixel in the image array