Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
models [2020/05/01 23:39] – [Supported file formats] admin | models [2020/11/04 14:49] – [Loading a model from file into an existing TGorillaModel instance] admin | ||
---|---|---|---|
Line 14: | Line 14: | ||
===== Supported file formats ===== | ===== Supported file formats ===== | ||
- | Currently it is allowed to use the following file-formats: | + | Currently it is allowed to use the following file-formats: |
^ Format | ^ Format | ||
- | | G3D | + | | G3D | ✔ | ✔ | ✔ | ✔ | |
- | | DAE | + | | DAE | ✔ | ✔ | ✔ | ✘ | |
- | | OBJ | + | | OBJ | ✔ | ✔ | ✘ | ✘ | |
- | | STL | <color #00FF00>✔</ | + | | STL | ✔ |✘ | ✘ | ✔ | |
- | | FBX | + | | FBX | ✔ | ✔ | ✘ |
- | | X3D | + | | X3D | ✔ | ✔ | ✔ | ✘ | |
- | | glTF | + | | glTF |
+ | | Babylon | ||
+ | | Sketchfab | ||
===== Loading a new model from file at runtime ===== | ===== Loading a new model from file at runtime ===== | ||
Line 36: | Line 38: | ||
Gorilla.STL.Loader, | Gorilla.STL.Loader, | ||
Gorilla.FBX.Loader, | Gorilla.FBX.Loader, | ||
+ | Gorilla.GLTF.Loader, | ||
+ | Gorilla.Babylon.Loader, | ||
Gorilla.Model; | Gorilla.Model; | ||
Line 66: | Line 70: | ||
Gorilla.STL.Loader, | Gorilla.STL.Loader, | ||
Gorilla.FBX.Loader, | Gorilla.FBX.Loader, | ||
+ | Gorilla.GLTF.Loader, | ||
+ | Gorilla.Babylon.Loader, | ||
+ | Gorilla.Sketchfab.Loader, | ||
Gorilla.Model; | Gorilla.Model; | ||
Line 86: | Line 93: | ||
* Gorilla.OBJ.Loader | * Gorilla.OBJ.Loader | ||
* Gorilla.STL.Loader | * Gorilla.STL.Loader | ||
- | * Gorilla.FBX.Loader,... | + | * Gorilla.FBX.Loader |
+ | * Gorilla.GLTF.Loader | ||
+ | * Gorilla.Babylon.Loader | ||
+ | * Gorilla.X3D.Loader | ||
+ | * Gorilla.X3DZ.Loader | ||
+ | * Gorilla.X3DVZ.Loader | ||
Only then the format loader is able to load the specific file. | Only then the format loader is able to load the specific file. | ||
+ | |||
+ | ===== Plugins ===== | ||
+ | |||
+ | ==== Sketchfab Plugin ==== | ||
+ | |||
+ | Since 0.8.2.1675 we provide a Sketchfab plugin directly by using our loading mechanism. | ||
+ | Before implementation you'll need to ensure you've got a valid Sketchfab account with username and password. | ||
+ | |||
+ | https:// | ||
+ | |||
+ | **Remarks: | ||
+ | To request those credentials contact support at https:// | ||
+ | |||
+ | The usage of the plugin is simular to other file formats in Gorilla3D. But instead of using the simple method headers, | ||
+ | you'll have to use the extended method call with a TGorillaLoadOptions parameter. | ||
+ | |||
+ | <file pascal> | ||
+ | // setup loading options to connect to sketchfab | ||
+ | LOpts := TGorillaLoadOptions.Create(FUID, | ||
+ | LOpts.FileInfo.OpenFormat := TGorillaFileOpenFormat.fofDownload; | ||
+ | |||
+ | LOpts.FileInfo.URL := Gorilla.Sketchfab.Loader.GORILLA_SKETCHFAB_URL; | ||
+ | LOpts.FileInfo.ClientId := < | ||
+ | LOpts.FileInfo.ClientSecret := < | ||
+ | LOpts.FileInfo.Username := < | ||
+ | LOpts.FileInfo.Password := < | ||
+ | | ||
+ | // set an individual download folder, where data is written to | ||
+ | // leave empty to use system temporary folders | ||
+ | LOpts.ExtractDirectory := ''; | ||
+ | |||
+ | try | ||
+ | // try loading sketchfab model | ||
+ | FModel := TGorillaModel.LoadNewModelFromFile(GorillaViewport1, | ||
+ | if Assigned(FModel) then | ||
+ | FModel.Parent := GorillaViewport1; | ||
+ | except | ||
+ | on E:Exception do | ||
+ | ShowMessage(' | ||
+ | end; | ||
+ | </ | ||
+ | |||
+ | The plugin will automatically download a zip-archive with a glTF file to your preferred folder (" | ||
+ | and tries to load the contained model. | ||
+ | Before requesting Sketchfab, the loader checks the ExtractDirectory for an already existing download of UID. | ||
+ | If a zip and gltf file already exists it will directly load it, instead of downloading again. | ||
+ | |||
+ | You have to take care yourself in case a previous download is invalid or decprecated. | ||
===== Exporting a model ===== | ===== Exporting a model ===== | ||
Line 135: | Line 195: | ||
end; | end; | ||
</ | </ | ||
+ | |||
==== STL Export ==== | ==== STL Export ==== |