Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
firststeps [2019/03/08 10:25] – created admin | firststeps [2020/11/06 09:23] – [First Steps] admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== First Steps ====== | ====== First Steps ====== | ||
- | The framework usage is quite the same as using Delphi | + | Handling Gorilla3D |
- | At first we need a viewport to display | + | The main difference is the usage of TGorillaViewport as the main component for display. |
+ | **You can no longer use a TViewport3D or TForm3D as basis for showing | ||
+ | The reason for that is, that Gorilla3D extends functionality a lot and needs special treatment, which the default viewport do not provide (f.e. Render-Passes, | ||
- | It is possible to use default firemonkey components like Buttons, Labels | + | But, let' |
- | + | ||
- | + | ||
- | ===== Creating a Gorilla3D Viewport | + | |
- | + | ||
- | You can find the viewport at designtime in the toolbar under: | + | |
- | + | ||
- | + | ||
- | Gorilla3D | + | |
- | + | ||
- | + | ||
- | Simply drag it onto your form or create it at runtime by the following method. | + | |
- | + | ||
- | **__CAUTION: | + | |
- | + | ||
- | + | ||
- | ===== Creating a viewport at runtime ===== | + | |
- | + | ||
- | If you need to create the Gorilla3D viewport at runtime, you can do it the following way: | + | |
- | + | ||
- | + | ||
- | <file pascal Form1.pas> | + | |
- | uses | + | |
- | FMX.UITypes, | + | |
- | Gorilla.Viewport; | + | |
- | + | ||
- | // in our form (TForm1) we added a field named " | + | |
- | procedure TForm1.FormCreate(Sender: | + | |
- | begin | + | |
- | FGorilla := TGorillaViewport.Create(Self); | + | |
- | FGorilla.Parent := Form1; | + | |
- | FGorilla.Color | + | |
- | end; | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | ===== Loading a new model from file at runtime ===== | + | |
- | + | ||
- | The main core component is TGorillaModel to load a model from file. Currently it allows the following formats: G3D, DAE, OBJ, STL, FBX, X3D. | + | |
- | + | ||
- | <file pascal Form1.pas> | + | |
- | uses | + | |
- | Gorilla.G3D.Loader, | + | |
- | Gorilla.DAE.Loader, | + | |
- | Gorilla.OBJ.Loader, | + | |
- | Gorilla.STL.Loader, | + | |
- | Gorilla.FBX.Loader, | + | |
- | Gorilla.Model; | + | |
- | + | ||
- | // in our form (TForm1) we added a field named " | + | |
- | procedure TForm1.FormCreate(Sender: | + | |
- | var LPath : String; | + | |
- | LAssetPckg : TGorillaAssetPackage; | + | |
- | begin | + | |
- | LPath := ' | + | |
- | LAssetPckg := nil; | + | |
- | FModel := TGorillaModel.LoadNewModelFromFile(FGorilla, | + | |
- | OpenDialog1.FileName, | + | |
- | FModel.Parent := FGorilla; | + | |
- | end; | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | ===== Loading a model from file into an existing TGorillaModel instance ===== | + | |
- | + | ||
- | <file pascal Form1.pas> | + | |
- | uses | + | |
- | Gorilla.G3D.Loader, | + | |
- | Gorilla.DAE.Loader, | + | |
- | Gorilla.OBJ.Loader, | + | |
- | Gorilla.STL.Loader, | + | |
- | Gorilla.FBX.Loader, | + | |
- | Gorilla.Model; | + | |
- | + | ||
- | // in our form (TForm1) we added a field named " | + | |
- | procedure TForm1.FormCreate(Sender: | + | |
- | var LPath : String; | + | |
- | LAssetPckg : TGorillaAssetPackage; | + | |
- | begin | + | |
- | LPath := ' | + | |
- | LAssetPckg := nil; | + | |
- | GorillaModel1.LoadFromFile(LAssetPckg, | + | |
- | OpenDialog1.FileName, | + | |
- | end; | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | To load a specific file format you need to include the specific format file: Gorilla.G3D.Loader, | + | |
+ | * [[viewport|Viewport]] | ||
+ | * [[models|Models]] | ||
+ | * [[animations|Animations]] | ||
+ | * [[materials|Materials]] | ||
+ | * [[default-material|DefaultMaterial]] | ||
+ | * [[runtime-material|RuntimeMaterial]] | ||
+ | * [[water|Water]] | ||
+ | * [[primitives|Primitives]] | ||
+ | * [[terrain|Terrain]] | ||
+ | * [[skybox|SkyBox]] | ||
+ | * [[particles|Particles]] | ||
+ | * [[physics|Physics]] | ||
+ | * [[fmodaudio|FMOD Audio]] | ||
+ | * [[assetsmanager|Assets Manager]] | ||
+ | * [[billboard|Billboard]] | ||
+ | * [[inventory|Inventory]] | ||
+ | * [[dialogues|Dialogues]] | ||
+ | * [[skillsystem|Skillsystem]] | ||
+ | * [[inputpolling|Input Polling]] | ||
+ | * [[pathfinding|Pathfinding]] | ||
+ | * [[renderpass|Render Pass]] | ||
+ | * [[shadows|Shadows]] | ||
+ | * [[water|Water]] | ||
+ | * [[bokeh|Bokeh]] | ||
+ | * [[deftypes|Internal Model Definition]] | ||
+ | * [[transparency|Transparency]] | ||
+ | * [[layer3d|2D FMX components]] | ||
+ | * [[scripting|Scripting]] | ||
+ | * [[interaction|Interaction]] | ||
+ | * [[charactercontrolling|CharacterControlling]] | ||
+ | * [[android|Android]] | ||
===== Building an app with Gorilla3D and Delphi 10.3 Rio for Android ===== | ===== Building an app with Gorilla3D and Delphi 10.3 Rio for Android ===== | ||
Line 106: | Line 52: | ||
Go to " | Go to " | ||
+ | {{ :: | ||
When installing Delphi 10.3 Rio, the default configuration is set to " | When installing Delphi 10.3 Rio, the default configuration is set to " | ||
+ | |||
+ | **Since Gorilla3D v0.8.1 we have to set NDK minimum API level to " | ||
Line 114: | Line 63: | ||
[DCC Error] E2597 C: | [DCC Error] E2597 C: | ||
</ | </ | ||
+ | |||
+ | Your app should tell Android that it needs at least OpenGL ES 3.0. This can be done in " | ||
+ | |||
+ | < | ||
+ | <!-- Tell the system this app requires OpenGL ES 3.0. --> | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | Change the attribute android: |