Re: [GD-Linux] Algorithm help
Brought to you by:
vexxed72
From: Jan E. <ch...@in...> - 2001-11-28 10:39:22
|
On Mon, 26 Nov 2001, Stephen J Baker wrote: > >> I have a 3D scene in which a "camera" glides over the terrain in normal >> FPS mode. The terrain is a normal 2D matrix of y-values, with the x- and >> z-coordinates spread evenly, i.e. a perfectly regular matrix. This works >> fine, and I take the y-coordinate for the camera (height above the >> terrain) from the matrix. So, if the camera is at (x,z) I get the camera >> height from something like this: >> >> height = map [int(x)][int(y)] > >Well, there are two answers to your problem. > >Obviously, you need to INTERPOLATE the 'height posts' in your >grid to get the camera height. Yes, this was the way to do it, and after some thinking it's also the obvious way. Thank you for the kind help and the code (which I used parts of). The movement is still a little bit jerky. I think I have an indexing bug somewhere in my code, but it's a lot smoother than it was before. Well, this must be one of the more perverse projects, as I do this experiment in Python. Not the fastest thing in the world, but very nice to work with. Chakie -- In the Beginning there was nothing, which exploded. -- Terry Pratchett, Lords and Ladies |