sky_blue
01-03-2007, 07:35 AM
hi,
how do i convert the indices of a height map array(i,j) to the (x,y) points on the object. for example, suppose i have an nxn height map array and a sphere having radius 'R'. i'm not being able to understand the following mapping
for (i=0 to n){
for (j=0 to n){
x = j-n/2
y = i-n/2
x = x * R/(n/2)
y = y * R/(n/2)
............
}
}
how do i convert the indices of a height map array(i,j) to the (x,y) points on the object. for example, suppose i have an nxn height map array and a sphere having radius 'R'. i'm not being able to understand the following mapping
for (i=0 to n){
for (j=0 to n){
x = j-n/2
y = i-n/2
x = x * R/(n/2)
y = y * R/(n/2)
............
}
}