Imitating Walking/Movement- interaction with ground

Started by
-1 comments, last by okonomiyaki 21 years, 10 months ago
It''s easy to implement controls to move the camera around, but I''m wondering what''s the best way to implement a first-person feeling of walking around on the ground. The ground is, lets say, bumpy, so one cannot simply extract the y value of the coordinate from a vertex or such. Does it require interpolation between vertices, and if so, how would one do that in 3-dimensions? To clarify, say that there''s a 5x5 heightfield that is rendered. I want to be able to feel like I''m walking on that. The x-value and z-value of the camera isn''t an issue; I need the y value to correspond to the terrain right below the camera (assuming the camera is about 5 units above the terrain to act like eye level). So at some points, the camera will be standing in the middle of one triangle. Am I supposed to interpolate between the three vertices to obtain the y-value corresponding to the point in the middle of the triangle/on that plane?

This topic is closed to new replies.

Advertisement