Note that there are some explanatory texts on larger screens.

plurals
  1. POopengl models do not overlap correctly cross platform
    primarykey
    data
    text
    <p>edit: I have added a few new lines of code to the beginning for depth buffering with no luck. See code..</p> <p>edit 2: I am constructing the model builder on a wxglcanvas via wxwidgets. I have initialized WX_GL_DEPTH_SIZE of 16 and WX_GL_DOUBLEBUFFER on top of enabling depthbuffering and glClear(GL_DEPTH_BUFFER_BIT) with no luck. One thing that might be useful to note is that when I draw a cone, it seems to be drawing the cone as if I am looking at the inside of it rather than the outside portion, so it looks as if it's concaved in.</p> <p>I have an odd problem where my openGL models do not overlap correctly. I am building a model builder so that the user can create and rotate a model on a canvas.</p> <p>For example: If I have a circle within a box and I rotate the model around, I can still see the circle within the box as if the box is transparent. How I picture this is that if the circle is in the box, I should not be able to see it. Does anyone have any guesses to what causes this type of problem? I have not implemented any type of transparency, so I'm not really sure what is causing this. I am still very new to openGL so a lot of my efforts have just been trying lines of code I find on the forums and hoping it works. Also, parts of this code are inherited from other programs.</p> <p>This problem seems to only occur in Ubuntu and not under Win 7 when I test my program after adding two lines of code (shown below).</p> <p>Here are some lines of code for drawing the models...</p> <pre><code>//Newly Added code glEnable(GL_DEPTH_TEST); glDepthFunc(GL_GEQUAL); glClearDepth(1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //End newly added code glGetIntegerv(GL_MATRIX_MODE, &amp;mm); glMatrixMode(GL_MODELVIEW); glLoadMatrixf(identity); GrGetInfo(); glViewport(0,0,gw-&gt;gc.width,gw-&gt;gc.height); GrGetInfo(); glMatrixMode(GL_PROJECTION); glLoadIdentity(); // Set some predefined parameters glOrtho ((GLdouble)tmpOtherAxis.minval, (GLdouble)tmpOtherAxis.maxval, (GLdouble)tmpRangeAxis.minval, (GLdouble)tmpRangeAxis.maxval, -range_dist, range_dist); glMatrixMode(mm); //ADDED THESE TWO LINES AND MODEL DISPLAYED //CORRECTLY IN WIN7 BUT NOT UBUNTU glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glPushMatrix(); //Draw model here glPopMatrix(); </code></pre> <p>Any help would be greatly appreciated, and feel free to ask me whatever questions you need regarding this.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload