User Tools

Site Tools


01_user_documentation:04_modeling:02_3d_modeling:02_visualization

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:04_modeling:02_3d_modeling:02_visualization [2025/11/02 02:22] – removed - external edit (Unknown date) 127.0.0.101_user_documentation:04_modeling:02_3d_modeling:02_visualization [2025/11/02 02:22] (current) – ↷ Page name changed from 01_user_documentation:04_modeling:02_3d_modeling:02_visuqlization to 01_user_documentation:04_modeling:02_3d_modeling:02_visualization gaetan
Line 1: Line 1:
 +====== 3D scene visualization ======
  
 +
 +GroIMP has an embedded 3d visualization view and manipulation toolkit. 
 +If the project graph contains 3d objects, or object that instantiate 3d objects, it is possible to visualize it in a scene with the [[:01_user_documentation:03_interacting_with_groimp:02_panels:03_3d:01_view|3d view]]. 
 +
 +
 +===== Project graph visitation =====
 +
 +To be displayed in the 3d scene, the project graph is visited by a **DisplayVisitor** (whose most common implementations are WFVisitor for the Wireframe view, and GLVisitor for the OpenGL 1 view). From the root, each Node with a **Successor** or **Branch** edge is visited. All nodes connected with other types of edges are ignored.
 +
 +Additionally, to impact the 3d display nodes needs to extends **Null** (de.grogra.imp3d.objects.Null), which represent the Nodes with 3d transformation. Each **Null** object have its own local transformation (could be null).
 +The DisplayVisitor goes through Nodes stacking their local transformation. Thus, the global transformation of an Object in the 3d scene, is the combination of all local transformations of all its parents (in the successor/branch sense).
 +
 +
 +===== Instantiation rules =====
 +
 +If a Node have a [[:01_user_documentation:07_rgg_xl:02_xl:08_object:01_module:05_instantiation|instantiation rule]], it is added before its local transformation. E.g. the following code display a Sphere, then a Cylinder.
 +
 +<code java>
 +module A extends Cylinder ==> Sphere;
 +</code>
 +
 +Produced geometry:
 +
 +{{:groimp-platform:3d:3dview_inst1.png?200|}}
 +
 +
 +But instantiation rules are not included in the graph and do not modify the stack of local transformation. 
 +Yet, they have their own stack. Thus, within an instantiation rule the 3d geometry shapes follow same local transformation concept. 
 +
 +E.g. the following code will display a Sphere on top of a Cylinder.
 +
 +<code java>
 +module A ==> Cylinder Sphere;
 +</code>
 +
 +Produced geometry:
 +
 +{{:groimp-platform:3d:3dview_inst2.png?200|}}