Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
1.1.0:models [2023/07/31 15:01] – created - external edit 127.0.0.11.1.0:models [2024/01/23 08:25] (current) – [Tutorial] admin
Line 11: Line 11:
  
 A TGorillaModel instance needs to be a child / sub-child of a TGorillaViewport instance, otherwise it will not be displayed. A TGorillaModel instance needs to be a child / sub-child of a TGorillaViewport instance, otherwise it will not be displayed.
 +
 +===== Tutorial =====
 +
 +{{youtube>-hGl4AsSxw8}}
 +
  
 ===== Supported file formats ===== ===== Supported file formats =====
Line 21: Line 26:
 | FBX         | ✔             | ✔                 | ✔          | ✘      | ✘       | ✘      | ✘       | ✘      | 7.1 - 7.7 | only binary format, animation import for 7.3 - 7.7| | FBX         | ✔             | ✔                 | ✔          | ✘      | ✘       | ✘      | ✘       | ✘      | 7.1 - 7.7 | only binary format, animation import for 7.3 - 7.7|
 | glTF/GLB        | ✔             |✔                  | ✘          | ✘      | ✘       | ✘      | ✘       | ✘      | 2.0       | only glTF 2.0 format| | glTF/GLB        | ✔             |✔                  | ✘          | ✘      | ✘       | ✘      | ✘       | ✘      | 2.0       | only glTF 2.0 format|
-| OBJ         | ✔             | ✔                 | ✘          | ✘      | ✘       | ✘      | ✘       ✘                | only ascii format|+| OBJ         | ✔             | ✔                 | ✘          | ✘      | ✘       | ✘      | ✘       ✔                | only ascii format|
 | STL         | ✔             |✘                   | ✘          | ✘     | ✘        | ✘      | ✘       | ✔     | 1.0       | ascii and binary format, Standard + Solidworks-Format| | STL         | ✔             |✘                   | ✘          | ✘     | ✘        | ✘      | ✘       | ✔     | 1.0       | ascii and binary format, Standard + Solidworks-Format|
 | X3D         | ✔             | ✔                 | ✔         | ✘      | ✘       | ✘      | ✘       | ✘      |           | deprecated | | X3D         | ✔             | ✔                 | ✔         | ✘      | ✘       | ✘      | ✘       | ✘      |           | deprecated |
Line 102: Line 107:
 ==== Sketchfab Import ==== ==== Sketchfab Import ====
  
-A great feature of Gorilla3D is the integrated Sketchfab support at design time.+A great feature of Gorilla3D is the integrated Sketchfab support at design time, which can be accessed by the TGorillaPrefabManager component. 
 + 
 +{{:1.1.0:g3d-sketchfab-1.jpg|}} 
 + 
 +{{:1.1.0:g3d-sketchfab-2.jpg|}}
  
-{{:1.0.0:g3d-ide-sketchfab.jpg?nolink|}}+{{:1.1.0:g3d-sketchfab-3.jpg|}}
  
 To take advantage of that feature: To take advantage of that feature:
-  - Drop a **TGorillaPrefabManger** component onto your form+  - Drop a **TGorillaPrefabManager** component onto your form
   - Select the component in structure view and right click onto it   - Select the component in structure view and right click onto it
   - A popup menu appears with an "Import from Sketchfab" option.   - A popup menu appears with an "Import from Sketchfab" option.
-  - A dialog with an UID input field appears, where you can simply type in the UID of a downloadable model on the Sketchfab platform: [[https://sketchfab.com/feed]] +  - Another dialogue will open to search for your specific model
- +
-You can find the UID of the relevant model in the URL, f.e. "https://sketchfab.com/3d-models/jellyfish-**e3546a2a88734c228bbc23ced4e1d1c9**"+
  
 The plugin will download the model as glTF file from Sketchfab into: The plugin will download the model as glTF file from Sketchfab into:
Line 776: Line 783:
 end; end;
 </file> </file>
 +
 +==== OBJ Export ====
 +
 +The OBJ exporter is capable of exporting multiple meshes and hierarchies into a *.obj file and to store material information in a separated *.mtl file.
 +
 +The MTL file will automatically be stored at the same location as the *.obj file with the *.obj.mtl extension.
 +
 +<file pascal>
 +
 +uses
 +  Gorilla.OBJ.Exporter;
 +  
 +procedure TForm1.MenuItem1Click(Sender: TObject);
 +var LOBJExp : TGorillaOBJExporter;
 +begin    
 +  if Assigned(FModel) then
 +  begin
 +    if SaveDialog1.Execute() then
 +    begin
 +        LOBJExp := TGorillaOBJExporter.Create();
 +        try
 +          LOBJExp.SaveToFile(FModel.Def as TModelDef, SaveDialog1.FileName);
 +        finally
 +          FreeAndNil(LOBJExp);
 +        end;
 +
 +        ShowMessage('File successfully stored:'#13#10+
 +          SaveDialog1.FileName);
 +      end;
 +  end;
 +end;
 +</file>
 +
 +
  
 Next step: [[animations|Animations]] Next step: [[animations|Animations]]