Monday 15 February 2010

c++ - OpenGL strange Rendering behaviour (flickering faces) -


Pre: I import an .3ds file to import aship (Open Asset) library I am using. Meshesh is provided with general and material. Using Qt We have tried on all the computers that have been tried on till today.

Post: When I am using the camera, I am using the camera around the objects, then I can see that some traps' shiny faces.

The same aship render () method (sample code downloaded from A. Wsite).

1) The strange thing is that it usually happens with a small size .3ds, it never happens with big people.

2) If I'm really close then there is no artistry. From far away I see more artifacts.

Is it the .3ds problem or mine?

Example Example of .3ds (20 MB) e

Example small .3ds (3 MB) Enter image details here

I use my draw () function (uses glLists but I can not get rid of them):

  Zero Preview :: BuildObjects List (view * Sk, galnum mode) {qhush & lt; QString, Visual Object * & gt; & Amp; Hash = sc- & gt; GetObj (); Int counter = 0; For (QUTSL, QString, SceneObject *>: Constiatorator i = hash.bugin (); i! = Hash.and (); ++ i) {glNewList (index-counter, GLNMPILE); Aries * p = dynamic_cast & lt; Aries * & gt; (I.value ()); If (p) {matrix 4x4 & amp; A = p-> GetTrasformation (); A.transpose (); If (mode == GL_SELECT) {glPushName (counter); } GlPushMatrix (); Gmalt Matrix ((float *) & amp; (a.values)); ApplyMaterial (p-> getMat ()); QList & LT; Face & gt; & Amp; Faccie = p- & gt; GetFaces (); Int Numerofas = Faisi. Coat (); QList & LT; Vector3D & gt; & Amp; Normals = p- & gt; GetNormals (); Bool HONNIMLES = (! (Normals.isEmpty ()); If (harmonic) glennable (gL_lighting); Second glDisable (GL_LIGHTING); For (int T = 0; T & lt; numeroface; ++ t) {foam & amp; F = faccie [t]; GLenum face_mode; Vector 3D * List = F. Nightmare; Int * listaNorm = f.normalIndex; Switch (f.numVertici) {case 1: face_mode = GL_POINTS; GlBegin (face_mode); If (hinormals) glanormal 3 FV (and (Normal [Listann Norm [0]]). [[0])); GlVertex3fv (& amp; लिस्टा [0] .pos [0]); break; Case 2: Face_mode = GL_Lines; GlBegin (face_mode); If (hinormals) {glNormal3fv (and (normals [(F. Normal Index) [0]]). Pos [0])); GlVertex3fv (& amp; लिस्टा [0] .pos [0]); GlNormal3fv (& amp; (normals [(f.normalIndex) [1]]) position [0])); GlVertex3fv (& amp; लिस्टा [1] .pos [0]); } And {glVertex3fv (& amp; [[0] [0] .pos [0]); GlVertex3fv (& amp; लिस्टा [1] .pos [0]); } break; Case 3: Face_mode = GL Triggles; GlBegin (face_mode); If (hnormals) {glNormal3fv (and normal ([f.normalIndex] [0]]. Pos [0]); glVertex3fv (& amp; लिस्टा [0] .pos [0]); glNormal3fv (& amp; (F.normalIndex) [1]] position [0]); glVertex3fv (& amp; लिस्टा [1] .pos [0]); glNormal3fv (& amp;; normals [(f.normalIndex) [2]] [ 0]); glVertex3fv (& amp; LISTA [2] .pos [0]);} and {glVertex3fv (& amp; listing [0] .pos [0]); glVertex3fv (& amp; LISTA [1] .pos [0]); glVertex3fv (& amp; LISTA [2] .pos [0]); break; default: face_mode = GL_POLYGON; break;; glend ();} GlPopMatrix ();} if (mode == GL_SELECT) GlPopName (); glEndList (); counter ++;}}    

12.040 depth buffering works, but Polygon appears to bleed through the polygon in front of them.What's happening?

You can configure your zNear and zFar clipping planers in a manner that will deepen your depth buffer accuracy Normally, this is due to a zNear clipping plane value, which is very close to 0.0.



No comments:

Post a Comment