FMX.LowLevel3D Sample
(Redirected from FMX.Mobile.LowLevel3D Sample)
This sample illustrates basic usage of low level 3D objects in mobile applications, using FireMonkey.
Contents
Location
You can find the FireMonkeyMobile LowLevel3D sample project at:
- Start | Programs | Embarcadero RAD Studio Alexandria | Samples and navigate to:
Object Pascal\Multi-Device Samples\User Interface\LowLevel3D
CPP\Multi-Device Samples\User Interface\LowLevel3D
- Subversion Repository:
- You can find Delphi and C++ code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version.
Description
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 one of the locations given above, and open:
- Delphi: LowLevel3D.dproj
- C++: LowLevel3D.cbproj
- Press F9 or choose Run > Run.
Notice the animated rectangular shape with the customized material.
Classes
- TForm1 represents the main window of the sample. It contains the following:
- two TBitmapObject objects used to set the two bitmaps used to create the new material.
- a TTimer used to create the animated rotation.
- TMyMaterial class defines the new material.
Implementation
- 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.
Uses
- FMX.Materials.TCustomMaterial
- FMX.Types3D.TShaderManager
- FMX.Types3D.TContextShaderSource
- FMX.Types3D.TContextShaderVariable
See Also
- FireMonkey Application Design
- FireMonkey
- FireMonkey 3D
- iOS Mobile Application Development
- Troubleshooting: Cannot Deploy to the iOS Simulator
- Troubleshooting: Cannot Deploy to the iOS Device
Samples
- FireMonkey 3D Arrows sample
- FireMonkey First App3D sample