Results 1 to 6 of 6

Thread: division by zero when using vertex array

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2002
    Posts
    3

    division by zero when using vertex array

    Hi ppl,

    I made a little program that renders a patch of terrain from a heightmap. Using a brute-force approach to render things works very well. Since I wanted to optimize things a bit, I implemented a vertex array. Now here's the problem: when rendering the terrain using the vertex array, I get a floating-point division by zero error whenever I move the viewpoint over a certain z-value. If I move over this boundary using a brute-force render, everything's fine. When I don't cross that particular value using vertex arrays, everything works fine too. I'm pretty sure that the coordinates I calculated for my array are correct. Any ideas??

    Jappie

  2. #2
    Senior Member OpenGL Guru knackered's Avatar
    Join Date
    Aug 2001
    Location
    UK
    Posts
    2,833

    Re: division by zero when using vertex array

    And this division by zero is in the driver dll/so, yes?
    Have you tried stepping through your code with a debugger?
    Knackered

  3. #3
    Junior Member Newbie
    Join Date
    Jan 2002
    Posts
    3

    Re: division by zero when using vertex array

    Well, that's kinda hard considering it only crashes when the z-value reaches a certain value. Where should I put the breakpoint in this case? Don't want to go into the debugger _every_ frame
    What I mean, isn't there some kind of catch when using vertex arrays that I forgot to take into account?

    Jappie

  4. #4
    Junior Member Newbie
    Join Date
    Aug 2001
    Location
    France
    Posts
    28

    Re: division by zero when using vertex array

    If you're using visual c++, then when your app crashes you can press the 'retry' button to debug at this moment.

  5. #5
    Senior Member OpenGL Pro
    Join Date
    Jun 2000
    Location
    Shreveport, LA, USA
    Posts
    1,502

    Re: division by zero when using vertex array

    I would suggest using a conditional breakpoint. Just break into the debugger when your z-value hits that certain value. Then slowly step through your code taking note of all values.

  6. #6
    Junior Member Newbie
    Join Date
    Jan 2002
    Posts
    3

    Re: division by zero when using vertex array

    Now this is nice: I tried compiling the program at home (made it at school, but haven't had any spare time whatsoever , and it works perfectly! Could the problem have something to do with the school-graphics card (Matrox G400) not having the vertex array extension, and the home graphics card (NVidia TNT2) having it?

    Anyway, thanks for all your replies, haven't tried that conditional breakpoint stuff yet, but it sounds mighty handy, and haven't tried the reply option yet 'cause I use Borland Builder

    Jappie

Similar Threads

  1. Generate Indices array from Vertex array
    By VirtualMan in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-28-2013, 02:51 AM
  2. a big vertex array or a ser of small vertex array?
    By lovemort in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 09-05-2013, 12:42 PM
  3. One Vertex Array or Multiple Vertex Arrays ?
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-24-2003, 09:16 AM
  4. Why no per-vertex material specification in vertex array?
    By MelvinEng in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-09-2001, 03:20 AM
  5. Mixing Vertex Array Range & 'normal' vertex arrays
    By MarcusL in forum OpenGL: Advanced Coding
    Replies: 7
    Last Post: 04-23-2001, 09:00 AM

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