FMX.Objects3D.TShape3D.WrapMode

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property WrapMode: TMeshWrapMode read FWrapMode write SetWrapMode default TMeshWrapMode.Stretch;

C++

__property TMeshWrapMode WrapMode = {read=FWrapMode, write=SetWrapMode, default=2};

Properties

Type Visibility Source Unit Parent
property published
FMX.Objects3D.pas
FMX.Objects3D.hpp
FMX.Objects3D TShape3D

Description

Specifies how a 3D object should fit in the bounding box of a control.

TMeshWrapMode introduces changes to the old shape rendering system. The TControl (usually a TShape3D) that is the owner of the TMeshData renders that TMeshData. In the past, the rendering of TMeshData was scaled relatively to the size of the owner of TMeshData. That resulted in some situations that were impossible or difficult to manage, such as:

  • How to locate a mesh inside the bounding box of a control.
  • How to properly import mesh data from an external program (the values for size were not respected, and the proportions were changed).

The introduction of the TMeshWrapMode makes the rendering system more flexible and adaptable to the needs of the user.

The following table shows the values of WrapMode and a brief description of them.

Value Description Figure

Fit

The 3D object is scaled until it fits in the bounding box of a control (the 3D object maintains its proportions). This is the default value for TModel3D.

Fit.png

Original

The 3D object is placed taking the center of the control as the coordinates origin. The 3D object is scaled relatively to the owner of the 3D object. For example, if the owner changes its size from (1, 1, 1) to (2, 2, 2), the size of the 3D object doubles. You can use Original wrap mode to ensure backwards compatibility.

Note: Original is not the default wrap mode of TModel3D because the main purpose of TModel3D is to import meshes.

Original.png

Resize

The control adapts its size so that the 3D object fits inside (the 3D object is not changed as in Original wrap mode).

Resize.png

Stretch

The 3D object is expanded until it fits in the bounding box of a control (the 3D object can lose its proportions). This is the default value for TShape3D.

Stretch.png

See Also