Results 1 to 5 of 5

Thread: Marching Cubes demo for FPC

  1. #1

    Marching Cubes demo for FPC

    I just grabbed the Marching Cubes demo code from here:

    http://paulbourke.net/geometry/polygonise/

    More specifically, the "marchingsource.cpp" code. It is C++, but really plain C, using GLUT. That means a very simple program structure, and very portable indeed. I could easily make it run perfectly on my Mac. Then I decided to port it to FPC.



    Source: http://www.ragnemalm.se/lightweight/marchingsource.pas

    This is converted and tested under OSX, but the code should be easy to port anywhere.

    Seriously, this is not the most modern code around. In particular, it uses OpenGL immediate mode, which should be replaced by arrays for better performance. To make it really good, computations should be performed on the GPU as far as possible.

    This might have been ported before, but I couldn't find anything like that in the forum so maybe it can be of some interest, not least considering its potential usage for water simulations.

  2. #2
    Great work! I was pretty shocked to see SO MANY numbers in that file! OMG
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  3. #3
    Modified a little to adjust to nxPascal. I don't use glut at all so those are commented out or removed. Didn't make replacement for wireframe code and some keys are propably not working, or maybe do but i don't see their effect. Most importantly blue orbs are bubbling around
    Here is source code and executable:
    Attached Files Attached Files

  4. #4
    This demo was ported long time ago by Jan Horn...

  5. #5
    Quote Originally Posted by Andru View Post
    This demo was ported long time ago by Jan Horn...
    I suspected there could be something like that. But that code doesn't look like a port, and isn't presented as such either. Based on the other though.

    And as a bonus, it is about time for a thread about Marching Cubes here.

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
  •