Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Terrain Editing - once again

  1. #11

    Terrain Editing - once again

    Quote Originally Posted by Brainer
    Thanks for useful hints. I'm going to write some code now using your and mine ideas. I'll let you know later about the result - I'll post the code then.

    .: EDIT !! :.
    I did some changes, but I don't know why my "favorite" error occurs (line 26. :?
    http://www.glsoftworks.pastebin.com/f5051d109
    Most likely it's related to
    Data.Heights[X, Y]

    And as i said, displaylist doesnt gonna help you, especially when you're goint to edit the terrain, displaylists is static by nature. Use vertex arrays as in you last code instead.
    Amnoxx

    Oh, and this code appears to be an approximate replacement for return(random() & 0x01);

    Phoenix Wiki
    http://www.phoenixlib.net/

    Phoenix Forum
    http://www.pascalgamedevelopment.com/viewforum.php?f=71

  2. #12

    Terrain Editing - once again

    Forgot to create DisplayList first?

    DisplayList:=glGenLists(1);
    glNewList(DisplayList, GL_COMPILE);
    ...

  3. #13

    Terrain Editing - once again

    Thanks, User137. Here is the newest try. This time nothing gets rendered. I dunno why. Could you take a look at the code? Sorry for my lame questions, but I'm not that advanced and I'd like to learn more by asking as much as possible.
    http://www.glsoftworks.pastebin.com/d69ddc039

  4. #14

    Terrain Editing - once again

    I don't see anything odd, i trust you've tested all the numeric things to work before, and couldn't help there without testing in delphi. But as perfectionist as i can be, there is something

    1.GL_COMPILE_AND_EXECUTE could be used to replace GL_COMPILE + glCallList as it's also faster way and simplify code.

    2.procedure TCell.RenderCell; creates displaylist but does not render it. Without seeing the main program this would explain the non showing only if render was not in loop (but i guess you got a timer so this point is non valid...).

    3.Extra variables controlling other variables sometimes make a mess. glGenLists(1) results a number that is always > 0, so uninitialized list would result 0.
    [pascal]if GotDisplayList then
    // means the same as
    if DisplayList>0 then[/pascal]

  5. #15

    Terrain Editing - once again

    Thank you for your tips! I'll do the changes you mentioned tomorrow and let you know.

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •