Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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
2  
An easy thing to do that doesn't involve collision detection would just be to figure out the height of the heightmap at a given X,Y location and just set the Z value (assuming Z is up) of the camera (plus some offset probably) there. – Tetrad May 7 '12 at 16:22
@Tetrad +1 That's the first step to collision, once you know the height (Z in your case) and you have XY, there ya go =) But just the height would work really well for a camera. – Patrick Hughes May 7 '12 at 19:07
This is a lot to ask in one go. Collision detection alone is a big topic. – Nicol Bolas May 8 '12 at 2:05
Thanks for commenting. I have tried something like that except I think the problem lies with rendering my heightmap and storing the x and z values (y is up for me). So I have rendered my heightmap from the array and then when each point is being rendered I save that value in another array so I have array of z and x and then test like that but it does not seem to work... – M1kstur May 12 '12 at 17:43

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.