Menu

GLLines and TGLBaseSceneObject troubleshooting

Help
Alex
2016-02-22
2016-02-27
  • Alex

    Alex - 2016-02-22

    Hi, I'm stuck with a problem with GLLines.
    I need to get runtime-created TGLLines, but I keep getting:

    [Error] Main.pas(938): Incompatible types: 'TGLLines' and 'TGLBaseSceneObject'

    How am I supposed to interact with TGLLines at all?
    I'm currently using a loop to find TGLLines as TGLBaseSceneObject, but it doesn't even compile.

    Thanks in advance. Alex

     
  • lnebel

    lnebel - 2016-02-23

    It is not clear what you are trying to do. Adding som code will help others to understand the problem.

    If your are testing for an object instance class you should not use the 'as' operator but the 'is' operator

    Lars

     
  • Jerome.D (BeanzMaster)

    Hi, don't forget TGLLine work with TGLLineNode
    Quick sample :

    var FUIScaleLineXY : TGLLines;
    //FUIRootScale is you parent object
      FUIScaleLineXY := TGLLines(FUIRootScale.addnewChild(TGLLines));
      with FUIScaleLineXY do
      begin
        Options := [loUseNodeColorForLines];
        SplineMode := lsmSegments;
        LineColor.Color := clrRed;
        LineWidth := 1;
        NodesAspect := lnaInvisible;
        AddNode(0, 0.7, 0);
        AddNode(0.35, 0.35, 0);
        TGLLinesNode(Nodes[0]).Color.color := clrLime;
        TGLLinesNode(Nodes[1]).Color.color := clrLime;
        AddNode(0.35, 0.35, 0);
        AddNode(0.7, 0, 0);
        TGLLinesNode(Nodes[2]).Color.color := clrRed;
        TGLLinesNode(Nodes[3]).Color.color := clrRed;
        AddNode(0.5, 0, 0);
        AddNode(0.25, 0.25, 0);
        TGLLinesNode(Nodes[4]).Color.color := clrRed;
        TGLLinesNode(Nodes[5]).Color.color := clrRed;
        AddNode(0.25, 0.25, 0);
        AddNode(0, 0.5, 0);
        TGLLinesNode(Nodes[6]).Color.color := clrLime;
        TGLLinesNode(Nodes[7]).Color.color := clrLime;
    end;
    
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.