Results 1 to 6 of 6

Thread: HeightMap demo keeps crashing :(

  1. #1

    HeightMap demo keeps crashing :(

    I'm proficient at Pascal but new to C / C++ so I thought I'd make a simple terrain engine to teach myself. I downloaded this tutorial ( ) and it looks great. However it keeps crashing consistently if I go left past a certain point or backwards past a certain point. I'm guessing this is caused by the value of a "positive only" variable getting decremented to a point where it goes below zero. I peeked at the source code but almost all the variables are floating point type. I'll pore over the code tomorrow in detail when I'm less tired ( right now my head is swimming just looking at it hehe )

    Any pointers ( pardon the pun ) would be appreciated.

  2. #2
    Senior Member Regular Contributor
    Join Date
    Mar 2001

    Re: HeightMap demo keeps crashing :(

    hmmm...i ran it and backed up so much, the geometry went past the far clipping plane, but it did not crash. did you get that far? i haven't looked at the code. did you recompile it and run it?


    [This message has been edited by coredump (edited 09-06-2002).]

  3. #3

    Re: HeightMap demo keeps crashing :(

    no i just ran the precompiled binary. Maybe its something in my setup or a combination of things. Im running a voodoo 5 5500 AGP under Win ME.

  4. #4

    Re: HeightMap demo keeps crashing :(

    man i feel so dumb in my haste, I posted the wrong link above the buggy example is

    i got a friend to download it and he gets the same error. Someone suggested changing the floats to long floats. I'll try that.

  5. #5
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Fargo, ND

    Re: HeightMap demo keeps crashing :(

    I doubt changing floats to "long floats" (otherwise known as doubles in C/C++) is going to fix a crashing error. Also setting an unsigned to a negative value doesn't cause a crash, it will simply set the value to the appropriate two's complement value.

    Crashes in C/C++ are almost always caused by touching memory that shouldn't be touched. Some examples of this would be going outside the bounds of an array or accessing a dangling pointer.
    Software Engineer and OpenGL enthusiast

  6. #6

    Re: HeightMap demo keeps crashing :(

    I never noticed the problem before when I've run this but tried it again and moved back for ages. Eventually I got the error... trying in IDE for debugging... no error occured this time... the last time that happened to me was due to a memory problem with an array not correctly set up.

    After some debugging the problem only seems to occur for me if I try to go beyond the skybox setup. Should be rectifiable by setting a test up to stop movement outside of the skybox.

    Learning OpenGL while working on sourceforge projects: and

Similar Threads

  1. heightmap
    By grimoire in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 08-09-2004, 06:26 PM
  2. heightMap help
    By Pops in forum OpenGL: Basic Coding
    Replies: 10
    Last Post: 09-20-2003, 02:02 AM
  3. Heightmap
    By in forum OpenGL: Linux
    Replies: 2
    Last Post: 11-27-2001, 01:07 AM
  4. Heightmap from TGA
    By MrShoe in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 08-15-2001, 12:21 PM
  5. heightmap
    By in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 12-12-2000, 09:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean