User Tools

Site Tools


01_user_documentation:03_interacting_with_groimp:10_import:04_reference

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
01_user_documentation:03_interacting_with_groimp:10_import:04_reference [2025/09/05 17:20] – removed - external edit (Unknown date) 127.0.0.101_user_documentation:03_interacting_with_groimp:10_import:04_reference [2025/09/05 17:20] (current) – ↷ Page moved from 01_user_documentation:03_interacting_with_groimp:06_import:04_reference to 01_user_documentation:03_interacting_with_groimp:10_import:04_reference gaetan
Line 1: Line 1:
 +===== 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");
 +      ]
 +    );
 +  ]