Sign up ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

I have loaded a .RAW file into a 2x2 array in my class. The way I am rendering it works fine but I am struggling to get the camera to move on top of the terrain. The terrain renders from 0,0,0 (x,y,z) as that is where I put my camera. My camera class allows to the "camera" to move through the scene.

I want to be able to "walk" on top of the terrain with some basic collision detection (if possible). Any tips on where to go for this or any tips?

share|improve this question
the Game Dev SE site might be able to provide you with some good links. You could ask the moderators to migrate this question there: – FrustratedWithFormsDesigner May 7 '12 at 15:54

1 Answer 1

If one assumes that (0, 1, 0) is the vector that poins to the sky, a collision occurs, when the terrains height at the cameras X and Z coordinates is greater or equal to the Y coordinate of the camera. The next thing is, the camera needs gravity to stick at the ground.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.