01_user_documentation:03_interacting_with_groimp:10_import:04_reference
Differences
This shows you the differences between two versions of the page.
| 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.1 | 01_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(" | ||
| + | |||
| + | 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, | ||
| + | [ | ||
| + | Reference(" | ||
| + | ] | ||
| + | ); | ||
| + | ] | ||
