Jump to content


height map to (x,y,z) conversion


1 reply to this topic

#1 sky_blue

    New Member

  • Members
  • Pip
  • 5 posts

Posted 03 January 2007 - 03:35 PM

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)
............

}

}

#2 dave_

    Senior Member

  • Members
  • PipPipPipPip
  • 584 posts

Posted 03 January 2007 - 03:42 PM

You've got the answer on gamedev.net already.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users