FMX.Mobile.LowLevel3D Sample (Object Pascal)
This sample illustrates basic usage of low level 3D objects in mobile applications, using FireMonkey.
You can find the FireMonkeyMobile LowLevel3D sample project at:
- Start | Programs | Appmethod | Samples and then navigate to Object Pascal\Samples\User Interface\LowLevel3D
- Subversion Repository: http://sourceforge.net/p/Appmethod/code/HEAD/tree/branches/Appmethod_113/Object%20Pascal/Samples/User%20Interface/LowLevel3D
This application defines a new Material using two predefined bitmaps and a random color. The new material is used to render a rotating rectangular shape within the 3D context of the application form.
How to Use the Sample
- Navigate to the location given above and open LowLevel3D.dproj.
- Press F9 or choose Run > Run.
Notice the animated rectangular shape with the customized material.
- TForm1 represents the main window of the sample. It contains the following:
- TMyMaterial class defines the new material.
- The new material is defined using low-level classes to manage graphical shaders: TContextShaderSource, TShaderManager, TContextShaderVariable. The rectangular shape and the new material are created on the OnRender event of the form.
- The drawing process is made through the TContext3D, associated to the TForm.