Note that there are some explanatory texts on larger screens.

plurals
  1. POOpenGL aliasing?
    primarykey
    data
    text
    <p>I am working on win7 microsoft visual studio 08 with Forms. I just changed my graphic card and some kind of aliasing appears in my application. </p> <p><a href="https://i.stack.imgur.com/yMSPd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yMSPd.png" alt="img"></a></p> <p>It can be apreciated that the grey lines are kind of aliased, and also the reference system, that is almost invisible. </p> <p>Any idea of how to solve this?</p> <p>I'll post some part of the code just in case: 1: Paint function</p> <pre><code>private: void Paint(){ int w = glControl1-&gt;Width; int h = glControl1-&gt;Height; float aspect_ratio = w / (float)h; Matrix4 perpective = Matrix4::CreatePerspectiveFieldOfView(MathHelper::PiOver4, aspect_ratio, 0.1f, 100000.0f); GL::MatrixMode(MatrixMode::Projection); GL::LoadMatrix(perpective); GL::MatrixMode(MatrixMode::Modelview); GL::LoadIdentity(); GL::Viewport(0, 0, w, h); //Situacion de la camara en el espacio Matrix4 lookat = Matrix4::LookAt(100, 100, 100, 0, 0, 0, 0, 0, 1); GL::LoadMatrix(lookat); GL::Scale(this-&gt;zoom, this-&gt;zoom, this-&gt;zoom); GL::Rotate(xrot, 1.0f, 0.0f, 0.0f); GL::Rotate(yrot, 0.0f, 1.0f, 0.0f); GL::Clear(ClearBufferMask::ColorBufferBit | ClearBufferMask::DepthBufferBit); GL::ClearColor(Color::LightGray); Draw3Daxis(); if (allowDraw){ DrawSurface(); } } </code></pre> <p>2: function that draws everything shown in the picture (it is just a bunch of GL::Vertex3)</p> <pre><code>System::Void Draw3Daxis(){ OpcionesPlot* opciones; opciones=OpcionesPlot::Instance(); int extra=2; int sqrnumber=10; //Planos en los ejes GL::Color3(Color::White); GL::Begin(BeginMode::Quads); if(opciones-&gt;draw3DXYaxis){ GL::Vertex3(0,0,0); GL::Vertex3(LENGTH,0,0); GL::Vertex3(LENGTH,LENGTH,0); GL::Vertex3(0,LENGTH,0); } if(opciones-&gt;draw3DXZaxis){ GL::Vertex3(0,0,0); GL::Vertex3(LENGTH,0,0); GL::Vertex3(LENGTH,0,LENGTH); GL::Vertex3(0,0,LENGTH); } if(opciones-&gt;draw3DYZaxis){ GL::Vertex3(0,0,0); GL::Vertex3(0,LENGTH,0); GL::Vertex3(0,LENGTH,LENGTH); GL::Vertex3(0,0,LENGTH); } GL::End(); // ejes XYZ GL::Color3(Color::Black); GL::Begin(BeginMode::Lines); if(opciones-&gt;draw3DXYaxis){ GL::Vertex3(0,0,0); GL::Vertex3(LENGTH+extra,0,0); GL::Vertex3(0,0,0); GL::Vertex3(0,LENGTH+extra,0); } if(opciones-&gt;draw3DXZaxis){ GL::Vertex3(0,0,0); GL::Vertex3(LENGTH+extra,0,0); GL::Vertex3(0,0,0); GL::Vertex3(0,0,LENGTH+extra); } if(opciones-&gt;draw3DYZaxis){ GL::Vertex3(0,0,0); GL::Vertex3(0,LENGTH+extra,0); GL::Vertex3(0,0,0); GL::Vertex3(0,0,LENGTH+extra); } //--&gt; lineas de los planos GL::Color3(Color::DarkGray); for(int i=1;i&lt;=sqrnumber;i++){ if(i==sqrnumber) GL::Color3(Color::Black); if(opciones-&gt;draw3DXYaxis){ GL::Vertex3(LENGTH/sqrnumber*i,0,0); GL::Vertex3(LENGTH/sqrnumber*i,LENGTH,0); GL::Vertex3(0,LENGTH/sqrnumber*i,0); GL::Vertex3(LENGTH,LENGTH/sqrnumber*i,0); } if(opciones-&gt;draw3DXZaxis){ GL::Vertex3(LENGTH/sqrnumber*i,0,0); GL::Vertex3(LENGTH/sqrnumber*i,0,LENGTH); GL::Vertex3(0,0,LENGTH/sqrnumber*i); GL::Vertex3(LENGTH,0,LENGTH/sqrnumber*i); } if(opciones-&gt;draw3DYZaxis){ GL::Vertex3(0,0,LENGTH/sqrnumber*i); GL::Vertex3(0,LENGTH,LENGTH/sqrnumber*i); GL::Vertex3(0,LENGTH/sqrnumber*i,0); GL::Vertex3(0,LENGTH/sqrnumber*i,LENGTH); } } GL::End(); // triangulos para los ejes //-----&gt;cuadrado GL::Color3(Color::Black); GL::Begin(BeginMode::Quads); float quadside=0.7; if(opciones-&gt;draw3DXYaxis){ GL::Vertex3((float)LENGTH+extra,quadside,quadside); GL::Vertex3((float)LENGTH+extra,-quadside,quadside); GL::Vertex3((float)LENGTH+extra,-quadside,-quadside); GL::Vertex3((float)LENGTH+extra,quadside,-quadside); GL::Vertex3(quadside,(float)LENGTH+extra,quadside); GL::Vertex3(-quadside,(float)LENGTH+extra,quadside); GL::Vertex3(-quadside,(float)LENGTH+extra,-quadside); GL::Vertex3(quadside,(float)LENGTH+extra,-quadside); } if(opciones-&gt;draw3DXZaxis){ GL::Vertex3((float)LENGTH+extra,quadside,quadside); GL::Vertex3((float)LENGTH+extra,-quadside,quadside); GL::Vertex3((float)LENGTH+extra,-quadside,-quadside); GL::Vertex3((float)LENGTH+extra,quadside,-quadside); GL::Vertex3(quadside,quadside,(float)LENGTH+extra); GL::Vertex3(-quadside,quadside,(float)LENGTH+extra); GL::Vertex3(-quadside,-quadside,(float)LENGTH+extra); GL::Vertex3(quadside,-quadside,(float)LENGTH+extra); } if(opciones-&gt;draw3DYZaxis){ GL::Vertex3(quadside,(float)LENGTH+extra,quadside); GL::Vertex3(-quadside,(float)LENGTH+extra,quadside); GL::Vertex3(-quadside,(float)LENGTH+extra,-quadside); GL::Vertex3(quadside,(float)LENGTH+extra,-quadside); GL::Vertex3(quadside,quadside,(float)LENGTH+extra); GL::Vertex3(-quadside,quadside,(float)LENGTH+extra); GL::Vertex3(-quadside,-quadside,(float)LENGTH+extra); GL::Vertex3(quadside,-quadside,(float)LENGTH+extra); } GL::End(); // --&gt; triangulos para hacer la punta GL::Begin(BeginMode::Triangles); if(opciones-&gt;draw3DXYaxis){ GL::Vertex3((float)LENGTH+extra,quadside,quadside); GL::Vertex3((float)LENGTH+extra,-quadside,quadside); GL::Vertex3(LENGTH+extra+5,0,0); GL::Vertex3((float)LENGTH+extra,-quadside,quadside); GL::Vertex3((float)LENGTH+extra,-quadside,-quadside); GL::Vertex3(LENGTH+extra+5,0,0); GL::Vertex3((float)LENGTH+extra,-quadside,-quadside); GL::Vertex3((float)LENGTH+extra,quadside,-quadside); GL::Vertex3(LENGTH+extra+5,0,0); GL::Vertex3((float)LENGTH+extra,quadside,-quadside); GL::Vertex3((float)LENGTH+extra,quadside,quadside); GL::Vertex3(LENGTH+extra+5,0,0); GL::Vertex3(quadside,(float)LENGTH+extra,quadside); GL::Vertex3(-quadside,(float)LENGTH+extra,quadside); GL::Vertex3(0,LENGTH+extra+5,0); GL::Vertex3(-quadside,(float)LENGTH+extra,quadside); GL::Vertex3(-quadside,(float)LENGTH+extra,-quadside); GL::Vertex3(0,LENGTH+extra+5,0); GL::Vertex3(-quadside,(float)LENGTH+extra,-quadside); GL::Vertex3(quadside,(float)LENGTH+extra,-quadside); GL::Vertex3(0,LENGTH+extra+5,0); GL::Vertex3(quadside,(float)LENGTH+extra,-quadside); GL::Vertex3(quadside,(float)LENGTH+extra,quadside); GL::Vertex3(0,LENGTH+extra+5,0); } if(opciones-&gt;draw3DXZaxis){ GL::Vertex3((float)LENGTH+extra,quadside,quadside); GL::Vertex3((float)LENGTH+extra,-quadside,quadside); GL::Vertex3(LENGTH+extra+5,0,0); GL::Vertex3((float)LENGTH+extra,-quadside,quadside); GL::Vertex3((float)LENGTH+extra,-quadside,-quadside); GL::Vertex3(LENGTH+extra+5,0,0); GL::Vertex3((float)LENGTH+extra,-quadside,-quadside); GL::Vertex3((float)LENGTH+extra,quadside,-quadside); GL::Vertex3(LENGTH+extra+5,0,0); GL::Vertex3((float)LENGTH+extra,quadside,-quadside); GL::Vertex3((float)LENGTH+extra,quadside,quadside); GL::Vertex3(LENGTH+extra+5,0,0); GL::Vertex3(quadside,quadside,(float)LENGTH+extra); GL::Vertex3(-quadside,quadside,(float)LENGTH+extra); GL::Vertex3(0,0,LENGTH+extra+5); GL::Vertex3(-quadside,quadside,(float)LENGTH+extra); GL::Vertex3(-quadside,-quadside,(float)LENGTH+extra); GL::Vertex3(0,0,LENGTH+extra+5); GL::Vertex3(-quadside,-quadside,(float)LENGTH+extra); GL::Vertex3(quadside,-quadside,(float)LENGTH+extra); GL::Vertex3(0,0,LENGTH+extra+5); GL::Vertex3(quadside,-quadside,(float)LENGTH+extra); GL::Vertex3(quadside,quadside,(float)LENGTH+extra); GL::Vertex3(0,0,LENGTH+extra+5); } if(opciones-&gt;draw3DYZaxis){ GL::Vertex3(quadside,(float)LENGTH+extra,quadside); GL::Vertex3(-quadside,(float)LENGTH+extra,quadside); GL::Vertex3(0,LENGTH+extra+5,0); GL::Vertex3(-quadside,(float)LENGTH+extra,quadside); GL::Vertex3(-quadside,(float)LENGTH+extra,-quadside); GL::Vertex3(0,LENGTH+extra+5,0); GL::Vertex3(-quadside,(float)LENGTH+extra,-quadside); GL::Vertex3(quadside,(float)LENGTH+extra,-quadside); GL::Vertex3(0,LENGTH+extra+5,0); GL::Vertex3(quadside,(float)LENGTH+extra,-quadside); GL::Vertex3(quadside,(float)LENGTH+extra,quadside); GL::Vertex3(0,LENGTH+extra+5,0); GL::Vertex3(quadside,quadside,(float)LENGTH+extra); GL::Vertex3(-quadside,quadside,(float)LENGTH+extra); GL::Vertex3(0,0,LENGTH+extra+5); GL::Vertex3(-quadside,quadside,(float)LENGTH+extra); GL::Vertex3(-quadside,-quadside,(float)LENGTH+extra); GL::Vertex3(0,0,LENGTH+extra+5); GL::Vertex3(-quadside,-quadside,(float)LENGTH+extra); GL::Vertex3(quadside,-quadside,(float)LENGTH+extra); GL::Vertex3(0,0,LENGTH+extra+5); GL::Vertex3(quadside,-quadside,(float)LENGTH+extra); GL::Vertex3(quadside,quadside,(float)LENGTH+extra); GL::Vertex3(0,0,LENGTH+extra+5); } GL::End(); Write3D(LENGTH,3,3,GLUT_BITMAP_9_BY_15,"X"); Write3D(3,LENGTH,3,GLUT_BITMAP_9_BY_15,"Y"); Write3D(3,3,LENGTH,GLUT_BITMAP_9_BY_15,"Z"); } </code></pre>
    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.
    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