Menu

Copy GLFreeForm From One GLScene to Another

Help
M.a.
2020-03-05
2020-04-06
  • M.a.

    M.a. - 2020-03-05

    Hi,
    How can I copy One or more GLFreeForm Object in One GLScene to Another at runtime ? And What is the best method Form copy of GLFreeForm in the same GLScene at runtime?
    Thank you.

     
  • Jerome.D (BeanzMaster)

    Hi you can try like this

    Var
      NewCube : TGLCube;
      //NewSphere : TGLSphere;
      // NewFreeForm : TGLFreeForm;
      SelectedObj, TargetObj : TGLBaseSceneObject;
    begin
     SelectedObj := GLCube1; // Object to copy in GLScene 1
     TargetObj := GLScene2.Objects; // GLDummyCube2 // Parent Target object in GLScene 2 or 1
    
     if SelectedObj is TGLCube then
     begin
       NewCube := TGLCube.CreateAsChild(TargetObj);
       NewCube.Assign(TGLCube(SelectedObj));
     end;
     //else
     //if SelectedObj is TGLSphere then
     //begin
     //  NewSphere := TGLSphere.CreateAsChild(TargetObj);
     //  NewSphere.Assign(TGLSphere(SelectObj));
     //end
     //if SelectedObj is TGLFreeForm then
     //begin
     //  NewFreeForm := TGLFreeForm.CreateAsChild(TargetObj);
     //  NewFreeForm.Assign(TGLFreeForm(SelectObj));
     //end  
     // etc....
    
     
  • M.a.

    M.a. - 2020-04-05

    Great Jerome.D,
    Thanks

     

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.