1

I'm using GLScene and have a problem with working GLDirectOPenGL. I want to draw a tringle on a scene but It draw only 3 edge of tringle and cannot to colorise the tringle. As you can see the trinanle has dot style that I dont want and not colorised.

  procedure TMain.GLDirectOpenGL1Render(Sender: TObject; var rci: TRenderContextInfo);
  begin
     gl.Begin_ (GL_TRIANGLES);
     gl.Color4f ( 1,0,0,1);   gl.Vertex3f( -0.13, 0.16,0.15 );
     gl.Color4f ( 0,0,1,1);   gl.Vertex3f( -0.61, 0.31,0.15 );
     gl.Color4f ( 0,1,0,1);   gl.Vertex3f( -0.5, 0.15,-0.1 );
     gl.End_; 
  end;

Capture of mu scene

genpfault
  • 51,148
  • 11
  • 85
  • 139
naser daneshi
  • 284
  • 1
  • 10
  • 3
    Looks like `glPolygonMode()` is set to `GL_LINE`, and sume `glLineStipple()` is active. If you haven't set this, then the library you are using did. GL is a state machine, and stuff will generally stay as they were last set. – derhass May 09 '15 at 18:45
  • Thank you for your helphing. I added glPolygonMode(GL_FRONT_AND_BACK, GL_FILL) to the code and it worked fine. – naser daneshi May 11 '15 at 06:44

0 Answers0