Menu

Temperatures mapping using GLfreeForm

Help
Sergio
2015-05-25
2015-06-04
  • Sergio

    Sergio - 2015-05-25

    I am using the code below to draw the values of a variable (temperatures) in a plane using a GLfreeform . The result is in this link here http://www.cognitor.com.br/RectangleMissingPart.png

    NumPTX, numPTY and Z[I,J,K] are constant values.

    There are two problems. The first one is that the coloured rectangles are not exactly where I want (this I think is solved with smaller squres) The second is the doubt I ask your help

    Looking for the code and the values of the variable res3DPlane (normalized) I would expect that the colored rectangles would be symmetrical as a vertical rectangle . If you look the figure , in the edges they are inclined ( like not completely coloured)

    Question1) What to do correct this? What is the purpose of the second part of TexCoords that I am putting as zero here?

    Question 2) I think it is now possible to trace isolines using TGLTerrain (new demo by Paul Pavel Vassiliev in recent post) . So I will try to the same using TGLTerrain.
    Nevertheless, is it possible to include the isolines in TGLfreeform ?

    Thank you in advance

    CODE

    PlaneXY.MeshObjects.clear ;
    ResultsMesh:= TMeshObject.CreateOwned (PlaneXY.MeshObjects) ;
    ResultsMesh.Mode:=momFaceGroups ;

    with ResultsMesh do
    begin
    Z[I,J,K]:= constant; // fixed value
    for I:= 1 to NumPTX do
    begin
    for J:= 1 to NumPTY do
    begin
    Vertices.Add( X[I,J,K], Y[I,J,K] , Z[I,J,K] );
    TexCoords.Add(res3DPlane[I,J,K],0) ;
    end;
    end;

              Quads:=TFGVertexIndexList.CreateOwned(ResultsMesh.FaceGroups);
              Quads.Mode:=fgmmQuads;
               for I:= 1 to NumPTX-1 do
                begin
                   for J:= 1 to NumPTY-1 do
                      begin
                         MMT:= (I-1)*NumPTY  + J -1 ;
                         Quads.VertexIndices.Add(  MMT           ,  MMT +1    ) ;
                         Quads.VertexIndices.Add(  MMT +NumPTY +1 ,  MMT +NumPTY ) ;
                      end;
                end;
     end;
    
    PlaneXY.StructureChanged
    
     
  • Sergio

    Sergio - 2015-05-25

    Correcting the truncated code above

    PlaneXY.MeshObjects.clear ;
    ResultsMesh:= TMeshObject.CreateOwned (PlaneXY.MeshObjects) ;
    ResultsMesh.Mode:=momFaceGroups ;

    with ResultsMesh do
    begin
    Z[I,J,K]:= constant; // fixed value
    for I:= 1 to NumPTX do
    begin
    for J:= 1 to NumPTY do
    begin
    Vertices.Add( X[I,J,K], Y[I,J,K] , Z[I,J,K] );
    TexCoords.Add(res3DPlane[I,J,K],0) ;
    end;
    end;

    Quads:=TFGVertexIndexList.CreateOwned(ResultsMesh.FaceGroups);
    Quads.Mode:=fgmmQuads;
    for I:= 1 to NumPTX-1 do
    begin
    for J:= 1 to NumPTY-1 do
    begin
    MMT:= (I-1)*NumPTY + J -1 ;
    Quads.VertexIndices.Add( MMT , MMT +1 ) ;
    Quads.VertexIndices.Add( MMT +NumPTY +1 , MMT +NumPTY ) ;
    end;
    end;
    end;

    PlaneXY.StructureChanged

     
  • Sergio

    Sergio - 2015-05-28

    The contourlines of the other post will fit here also

     
  • Sergio

    Sergio - 2015-06-04

    In the post related to the temperatures mapping I still cannot understand why the mapping is inclined (see figure attached) The code is above
    Possibly the reason is some setting for the texture that I do not know how to do
    The code is above
    Please try to help me

     

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.