01_user_documentation:03_interacting_with_groimp:10_import:04_reference
Table of Contents
Referencing External 3D Models
GroIMP allows the reuse of external 3D models (e.g., ``.dtd`` files created in the RGG editor) by referencing them directly in XL code. This is done using the ``Reference(…)`` constructor.
Basic Usage
To instantiate a 3D object into the scene:
Reference("cherry_new.dtd");
This creates a single node representing the geometry of the external object but does not import its internal graph structure.
Example: Multiple Instances
This example creates three identical tree models placed along the y-axis:
protected void init()
[
Axiom ==> for(int i=0; i<3; i++)(
Translate(0, 1, 0)
[
Reference("cherry_new.dtd");
]
);
]
01_user_documentation/03_interacting_with_groimp/10_import/04_reference.txt · Last modified: 2025/09/05 17:20 by gaetan
