Show: Delphi C++
Display Preferences

Importing a 3D Model in a FireMonkey Application

From RAD Studio XE3
Jump to: navigation, search

Go Up to Tutorial: Importing 3D Models (FireMonkey)

This tutorial shows, step by step, how to import a 3D model.


Create a FireMonkey HD or 3D Application and Add Components

  1. Select File > New > Other > Delphi Projects > HD FireMonkey Application:
    FireMonkey HD Application.png   
     Creating a Delphi HD Application
    FireMonkey HD Application c++.png
    Creating a C++ HD Application
    Note that a 3D model can also be imported using 3D FireMonkey Application.
  2. Add a TViewport3D component to your form.
    If you are using a 3D FireMonkey Application, skip this step; a 3D form already contains a TViewport3D component.
  3. Add a TLight as a child of the TViewport3D component. Add TLight as follows:
  4. Add a TModel3D as follows:
    Types of applications for 3D importers.png

Import a 3D Model Using the Mesh Collection Editor

  1. Select the added TModel3D in the Structure View.
  2. In the Object Inspector, open the Mesh Collection Editor by clicking the ellipsis [...] in the MeshCollection field on the Properties page:
    MeshColection in Properties.png

  3. Load a 3D format file by pressing the Load button on the Mesh Collection Editor and navigating to a 3D file (.ase, .dae, .obj).
    MeshColection Editor2.png

  4. After the model is loaded and displayed in the Mesh Collection Editor, you can scale the model using the trackbar on the right side of the Mesh Collection Editor. You can also rotate the model by clicking the model and dragging it in the opposite direction of the desired rotation. When the model is in position and is correctly scaled, click OK on the Mesh Collection Editor to display the model on the form:
    3d model in form at design time.png

  5. Run the project:
    3d model in form at run time .png


See Also

Personal tools
Previous Versions
In other languages