Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8189917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:26:40+00:00 2026-06-07T03:26:40+00:00

I am working on win7 microsoft visual studio 08 with Forms. I just changed

  • 0

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.

img

It can be apreciated that the grey lines are kind of aliased, and also the reference system, that is almost invisible.

Any idea of how to solve this?

I’ll post some part of the code just in case:
1: Paint function

private: void Paint(){



        int w = glControl1->Width;
        int h = glControl1->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->zoom, this->zoom, this->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();
            }
        }

2: function that draws everything shown in the picture (it is just a bunch of GL::Vertex3)

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->draw3DXYaxis){
            GL::Vertex3(0,0,0);
            GL::Vertex3(LENGTH,0,0);
            GL::Vertex3(LENGTH,LENGTH,0);
            GL::Vertex3(0,LENGTH,0);
         }
         if(opciones->draw3DXZaxis){
             GL::Vertex3(0,0,0);
             GL::Vertex3(LENGTH,0,0);
             GL::Vertex3(LENGTH,0,LENGTH);
             GL::Vertex3(0,0,LENGTH);
         }
         if(opciones->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->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->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->draw3DYZaxis){
             GL::Vertex3(0,0,0);
             GL::Vertex3(0,LENGTH+extra,0);
             GL::Vertex3(0,0,0);
             GL::Vertex3(0,0,LENGTH+extra);
        }

         //--> lineas de los planos
         GL::Color3(Color::DarkGray);
         for(int i=1;i<=sqrnumber;i++){
             if(i==sqrnumber)
                 GL::Color3(Color::Black);
             if(opciones->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->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->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
        //----->cuadrado
        GL::Color3(Color::Black);
        GL::Begin(BeginMode::Quads);
        float quadside=0.7;
        if(opciones->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->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->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();


        // --> triangulos para hacer la punta
        GL::Begin(BeginMode::Triangles);
        if(opciones->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->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->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");
     }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T03:26:42+00:00Added an answer on June 7, 2026 at 3:26 am

    Try disabling depth testing before drawing each set of objects (reference planes first, axes second and then the reference grid).

    It looks like your axes are Z-fighting the reference planes.

    You have multiple options –

    1. Disable depth test when drawing the lines (not the planes). This will make sure that no z-fighting occurs.
    2. Keep depth testing on, but use glPolygonOffset when drawing the planes to offset them so that z-fighting does not happen at all.
    3. Use GL_LEQUAL (or whatever else) as the DepthFunc when drawing the planes, but use GL_EQUAL when drawing the lines. This should make things ok.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

OS: Win7 IDE: Visual Studio 2010 Boost Version: 1.47 I'm new to Boost and
I have a TAPI Application (Delphi 2007) working on 32bits OSs (XP, Vista, Win7).
I recently upgraded from Vista/32 to Win7/64. On my old machine, everything was working
Working on game where plates will be falling from top to bottom. Some plates
I created an application uses CreateOLEObject(CDO.Message) Everything is working fine in my machine, but
Who can help me with this: I am working on Win7 x64, with VS.net
I'm working with a Win32 application that needs to create a variety of custom
I've got a WinForms application that I am working on. There is one small
Hi I am working on win7 64 bit system , AVD running quite slow
I am working on a program. In testing it on Win7(32-bit, don't know if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.