Menu

Six single objects TO a TGLfreeform object

Help
Sergio
2017-05-27
2017-06-09
  • Sergio

    Sergio - 2017-05-27

    I will ask my question using the demo Rendering > Lining
    In that demo we have 6 single objects. Is it possible to “save” that set of 6 objects after they are created as a TGLfreeform object ?
    He intention is to use the new freeform as the bacground in another code. If this is possible to do is there a demo showing how to do it ?

     
  • Jerome.D (BeanzMaster)

    Yes normaly just save to native format (.glsm) with savetofile it will we be enought. I can't test Lining demo under lazarus it has a bug with TGLLineNode and TCollection.

     
  • Sergio

    Sergio - 2017-05-27

    Thanks Jerome. Good news but as I never did that please tell me ... What should I save as glsm ?

     
  • Sergio

    Sergio - 2017-05-27

    Clicling in the GLscene editor I saw now .... the button Save all Scene ( as gls) I did this and saved. The doubt now is how to bring this saved file to use in another code

     
  • Jerome.D (BeanzMaster)

    Simply just use TGLFreeForm.SaveToFile in the code for saving mesh into a glsm file.

     
  • Pavel Vassiliev

    Pavel Vassiliev - 2017-05-28

    Hi Sergio,

    The doubt now is how to bring this saved file to use in another code <<<
    See Archipelago advdemo - there is a ship in glsm format
    PW

     
  • Sergio

    Sergio - 2017-06-09

    Hi Jerome. Sorry but it is not clear enough for me. Suppose for example that I have a code with a TGLscene component in which the is a single cube (design time) . When I run the code anther runtime cube will be cretaed .They are static. So after running I will see in the screen two cubes.
    My qyestion is: which lines of code I should put in the FormClose event a code to save the scene I see (two cubes) in a file of the type gls or glsm or any other MESH format . The intention is to use / import / load this file in another code into a a freeform component to be used as background of another scene.

     
  • Sergio

    Sergio - 2017-06-09

    Correcting the speling and including more information

    It is not clear enough for me. I need to “save the whole scene” in runtime . Suppose for example that I have a code with a TGLscene component in which there is a single cube (design time) . When I run the code I create in runtime another cube .They are static. So after running the code I will see in the screen two cubes. My question is: which lines of code I should put in the FormClose event to save the scene (two cubes) in a glsm format (or another mesh format) . My intention is to import this file in another code into a freeform component to be used as background of another scene.
    Another doubt: I opened a GLscene code (design time) and clicked the TGLscene component twice. After this I clicked the button “Save Whole Scene”. Then I ran the demo GLSviewer and tried to open the saved file but I got the error “Read error TGL binary Reader read type error. Know why ?

     
  • Jerome.D (BeanzMaster)

    Hi Sergio for saving scene you can do directly with TGLScene.SvaeToFile but Freeform's datas (vertices, uv..) are not saved.

    2nd Solution convert all object to freefrom (see meshes/FeedBack demo)put in a TGLFreeForm as submesh then savetofile (glsm format)

    3nd Solution you can use TGLVFSPak or TGLArchiveManager tou put all needed file in a sort of ZIP

    I'll try to make a little sample this week end

     
  • Sergio

    Sergio - 2017-06-09

    Thank you very mucjh Jerome. I will study the three solutions. A little sample would be very useful

     

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.