Menu

=?GBK?Q?Export_model_files_Incorrect_=A3=AC_why=A3=BF?=

Help
sxbug
2018-09-15
2018-09-19
  • sxbug

    sxbug - 2018-09-15

    Hi

    I am using GLScene 1.7, but I could not export any Model file. I tried to export a 3DS file ,but 3dsMax 2017 cannot import, prompt : invalid file . The code is as follows,Thanks.

    procedure TForm2.Button1Click(Sender: TObject);

    var

    ext : String;

    begin

    savedialog1.Filter:='3DS file|.3DS|OBJfile|.OBJ|SMDfile|.SMD|MD2 file|.MD2|TIN file|.TIN|PLY file|.PLY|STL file|*.STL';

    savedialog1.DefaultExt:='3DS';

    if SaveDialog1.Execute then

    begin

    ext := ExtractFileExt(SaveDialog1.fileName);
    
    if ext = '' then
    
      SaveDialog1.fileName :=
    
        ChangeFileExt(SaveDialog1.fileName,
    
        '.' + GetVectorFileFormats.FindExtByIndex
    
        (SaveDialog1.FilterIndex, False, True));
    
    if GetVectorFileFormats.FindFromFileName(SaveDialog1.fileName) = nil then
    
      ShowMessage('unsupport type.')
    
    else
    
      GlScene1.SaveToFile(SaveDialog1.fileName);
    
      //GLFreeForm1.SaveToFile(SaveDialog1.fileName);
    

    end;

    end;

     
  • Jerome.D (BeanzMaster)

    Hi sxBug, i think 3DSMax doidn't support anymore the 3DS Version export in GLScene. Have you try with obj ?

     
  • sxbug

    sxbug - 2018-09-18

    Thanks at first.If the GLscene contains some entity model (just like box,sphere etc), there's no problem for exporting by your way. If the GLscene only cantain some points , It can't export anything? How can I do for export these points?

    export obj file:# OBJ-File exported by GLScene

    0 Vertices

    0 Normals

    0 Texture-Coordinates

    Thanks

     
  • sxbug

    sxbug - 2018-09-18

    This shape is made up of many points.

     
  • Jerome.D (BeanzMaster)

    Hi, did you use TGLFreeForm or TGLMeshObject for create your object ? If not it's normal.
    If you're using TGLPoint it not work too.
    For Cube, sphere, etc... the objects are converted before the export, but not all glscene's objects, it depend of the "nature" of the object

     
  • sxbug

    sxbug - 2018-09-19

    Do you have a sample for convert points to a mesh ? Thanks

     
  • Jerome.D (BeanzMaster)

    In your case you have two solution.
    1st - Convert point to sphere or cube.
    2st - Add your points as vertices in a TGLFreeForm look at this topic https://sourceforge.net/p/glscene/discussion/93606/thread/37184757/#778f and in my meshhelper unit for example

     

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.