   how take the position Y (HEIGHT) of a map. x
  how take the position Y (HEIGHT) of a map. x starting a coordinated XZ, to fit the camera with map.I use Directx 9 and C++File/Object 3D  *.x   
  Look into ray-casting and ray-plane/ray-triangle intersection. Barycentric coordinates will be useful knowledge as well. D3DX does have some mesh intersection methods, but they're not usually fast enough for a critical path like this so you're often better implementing from first principles...For heightmaps or other regular/procedural geometries you can often boil the equations down to very simple linear equations if you always know two axis and know its a projection along the 3rd.hthJack   ;  Hi, thanks for replying but as I do that?"ray-casting and ray-plane/ray-triangle intersection"you have a sample ??  thank;  Look at the 'Pick' sample in the SDK. It's more general purpose than you need, but you can extract the appropriate equations without too much trouble.hthJack   ;Quote:Original post by jollyjeffersLook at the 'Pick' sample in the SDK. It's more general purpose than you need, but you can extract the appropriate equations without too much trouble.hthJackhiI saw, but do not understand veryi go see more.Thank   ;  Given a 2D height map this interpolates to get the height at any given 2D point on that map. So in a height map of 512x512 and you want to get the height at point (200.11, 170.65) it will interpolate between the points (200,170) and (201, 170) then interpolate between (200, 171) and (201, 171) then it will interpolate between those two values.public float getHeightAtLoc(float xf, float zf)   {  try  { Vector2 pos = new Vector2(xf, zf); int cellX = (int)pos.X;    //Rounds down int cellY = (int)pos.Y; float modX = pos.X % 1; float modY = pos.Y % 1; float TopLin = MathHelper.Lerp(heightData[cellX, cellY], heightData[cellX + 1, cellY], modX); float BotLin = MathHelper.Lerp(heightData[cellX, cellY + 1], heightData[cellX + 1, cellY + 1], modX); heightAtLoc = MathHelper.Lerp(TopLin, BotLin, modY); return heightAtLoc;  }  catch (Exception e)  { return 0;  }   };Quote:Original post by DargGiven a 2D height map this interpolates to get the height at any given 2D point on that map. So in a height map of 512x512 and you want to get the height at point (200.11, 170.65) it will interpolate between the points (200,170) and (201, 170) then interpolate between (200, 171) and (201, 171) then it will interpolate between those two values.*** Source Snippet Removed ***Hi, thank, but my scene is 3D :(it is very difficultI'm pulling on collision is 1 months:(