Results 1 to 7 of 7

Thread: List of voxels. Struggle to display.

  1. #1
    Junior Member Newbie
    Join Date
    May 2009
    Posts
    3

    List of voxels. Struggle to display.

    Hi to all,

    I did a C++ program performing calculations to get a huge list of voxels (3D pixels). My voxels are objects with parameters describing their first corner position in space (x1,y1,z1) and a side measure.

    Now, I want to display these cubes(voxels) in a 3D cartesian plan using glut.

    I tried to use the glutSolidCube(dim) function to generate each voxel by looping in my list but it doesn't work. I tried to place this loop inside the usual, as presented in tutorials, Display function. I feel I'm trying to force an unorthodox method of doing...

    Can you point me an example, a reference site or explain the concepts usually used to proceed in such cases. I dont know where to check anymore. I just want to hack my way and then refine my prog.

    Thanks in advance,

    Zetan

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: List of voxels. Struggle to display.

    I tried to use the glutSolidCube(dim) function to generate each voxel by looping in my list but it doesn't work.
    Well it should be fine.
    What does not work ? You see nothing, or garbage ?

    Then after that there are ways to improve performance, depending on what geometry is dynamic, and what is fixed.

  3. #3
    Junior Member Newbie
    Join Date
    May 2009
    Posts
    3

    Re: List of voxels. Struggle to display.

    Nah... Its weird.

    I moved files around and my project was not linked with glut32.lib.

    Now, the compilation proceeds over the Display() but I then have an error with:

    undefined reference to 'glEnable@4'

    for the line that corresponds to the glEnable(GL_CULL_FACE) function call. I checked on the internet and it is still a linking error. I'll do my best.

    bye the way, thanks for the quick answer.

  4. #4
    Senior Member Regular Contributor
    Join Date
    Dec 2008
    Location
    USA
    Posts
    134

    Re: List of voxels. Struggle to display.

    Make sure that you're linking with the regular OpenGL libraries, like OPENGL.DLL or GL.DLL (I don't actually know what it is on Windows, but it's something like that). That library should define glEnable.

  5. #5
    Senior Member Frequent Contributor _NK47's Avatar
    Join Date
    Mar 2008
    Posts
    574

    Re: List of voxels. Struggle to display.

    opengl32.lib

  6. #6
    Junior Member Newbie
    Join Date
    May 2009
    Posts
    3

    Re: List of voxels. Struggle to display.

    First, thanks to all of you for taking the time to answer my questions.

    I fix the compilation issue by going with Visual Studio instead of Codeblocks. It's sad, cause I prefer CB.

    Anyway, I continue my learning of OpenGl with the SuperBible cause my program is just freezing. My list is huge, something like 10^6 entries... and I know my use of the API is just bad. I'm closer by using double buffering, but I think I really need to fill a data structure, which I don't know yet, and then draw. I'll give you news once I find my trail.

    zetan

  7. #7
    Member Newbie
    Join Date
    May 2009
    Location
    Portugal
    Posts
    45

    Re: List of voxels. Struggle to display.

    I don't know if this is what you're looking for but you might have a go with display lists...
    "If you can't be a good example, you'll have to serve as a good warning..."

Similar Threads

  1. struggle in bug error MSVCRTD.dll
    By Renoald in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 08-21-2011, 03:35 AM
  2. display list
    By Andrew Waller in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 01-24-2006, 07:57 AM
  3. Display list corruption when list created in shared library
    By Michael Wouters in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 09-16-2005, 10:55 PM
  4. To display list or not to display list
    By funk in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 05-20-2001, 12:54 AM
  5. Display list to display models...Should I use them?
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-27-2000, 12:49 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