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
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
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.
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
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
Hi, don't forget TGLLine work with TGLLineNode
Quick sample :