User Tools

Site Tools


01_user_documentation:06_graph:03_graphs:01_project_graph:09_additional_root

Additional root

You can create any root you want :O

This roots are untouched by the reset function of RGG.

customRoot.rgg
 
// import other compiled files (.rgg, .java, .xl) without subdirectory path.
import parameters.*;
 
module A(float len) extends Sphere(0.1)
{
	{setShader(GREEN);}
}
 
module Base;
 
protected void init ()
[
	Axiom ==> Base A(parameters.length);
]
 
public void run ()
[
	A(x) ==> F(x) [RU(30) RH(90) A(x*0.8)] [RU(-30) RH(90) A(x*0.8)];
]
 
/**
* This function creates a clone of all Nodes below Base (so all of the plant) and adds it to the new root "test"
*
**/
public void toto()
{
	Node b = cloneSubgraph(first((*Base*)));
	graph().setRoot("test",b);
}
01_user_documentation/06_graph/03_graphs/01_project_graph/09_additional_root.txt · Last modified: 2026/03/23 18:18 by Tim