meta data for this page
  •  

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
geometry_forces [2021/04/07 12:41] croftgeometry_forces [2023/07/10 11:34] (current) steph.jorgensen
Line 1: Line 1:
-======Geometry Forces======+======Geometry forces======
 When you need scene geometry to control anything about your model then you’ll need to take advantage of Geometry Forces.  Example scenarios include vines crawling on a fence, a building preventing tree branches from growing near it, and roots growing in and around each other without intersecting.  Geometry Forces are accessed just like all of the other forces (“Geometry” is just another type of force like Direction, Magnet, etc.) and perform the following tasks. When you need scene geometry to control anything about your model then you’ll need to take advantage of Geometry Forces.  Example scenarios include vines crawling on a fence, a building preventing tree branches from growing near it, and roots growing in and around each other without intersecting.  Geometry Forces are accessed just like all of the other forces (“Geometry” is just another type of force like Direction, Magnet, etc.) and perform the following tasks.
    
   * Identify the geometry to be used (either a mesh asset or parts of the model itself)   * Identify the geometry to be used (either a mesh asset or parts of the model itself)
   * Position it in the scene (if it’s a mesh asset, model parts remain where they are)   * Position it in the scene (if it’s a mesh asset, model parts remain where they are)
-  * Embed it in the output (if it’s a mesh asset, model pars already are)+  * Embed it in the output (if it’s a mesh asset, model parts already are)
   * Specify how things behave around the geometry (attracted to it, avoid it, ignore it, etc.)   * Specify how things behave around the geometry (attracted to it, avoid it, ignore it, etc.)
   * Specify what happens if anything hits the geometry (crawl around it, stop, etc.)   * Specify what happens if anything hits the geometry (crawl around it, stop, etc.)
Line 15: Line 15:
  
  
-=====Adding a Geometry Force=====+=====Adding a geometry force=====
 Geometry Forces are added just like any other force.  Use the toolbar force button, right click in the Tree Window, or click the forces icon in the Generation Editor and select: Geometry Forces are added just like any other force.  Use the toolbar force button, right click in the Tree Window, or click the forces icon in the Generation Editor and select:
  
Line 22: Line 22:
 This will add an empty Geometry Force to your scene. This will add an empty Geometry Force to your scene.
  
-=====Assigning Geometry=====+=====Assigning geometry=====
 Geometry Forces can use mesh data from two sources: mesh assets (imported models) or generators (meshes created by the procedural modeler). Geometry Forces can use mesh data from two sources: mesh assets (imported models) or generators (meshes created by the procedural modeler).
  
-==== Mesh Assets ====+==== Mesh assets ====
 Create a mesh asset by importing a model.  In the sample mentioned above we’ve used a simple model of a rook from a Chess set.  Select the Geometry Force and do the following to use it. Create a mesh asset by importing a model.  In the sample mentioned above we’ve used a simple model of a rook from a Chess set.  Select the Geometry Force and do the following to use it.
  
Line 31: Line 31:
   * Select your mesh asset with the property “Geometry:Mesh Asset:Mesh”   * Select your mesh asset with the property “Geometry:Mesh Asset:Mesh”
  
-{{ :geometry_forces_mesh_asset_mesh.png?nolink&400 |PROPERTIES ROOK IMAGE}}+{{geometry_forces_mesh_asset_mesh.png?nolink&400}} 
  
 If you’re using a mesh asset, you can assign a material to it, embed it in the model, and transform it with the scene gizmo using the other properties in the “Geometry:Mesh Asset” group.  If you’re using a mesh asset, you can assign a material to it, embed it in the model, and transform it with the scene gizmo using the other properties in the “Geometry:Mesh Asset” group. 
Line 44: Line 45:
 If you’re using generators, this geometry will update every time the model updates. You don’t need to do anything else.  This feature enables you to freely change the model and have other parts of the model update accordingly.  You can add or remove generators as you like and you can have as many geometry forces as you need. If you’re using generators, this geometry will update every time the model updates. You don’t need to do anything else.  This feature enables you to freely change the model and have other parts of the model update accordingly.  You can add or remove generators as you like and you can have as many geometry forces as you need.
  
-{{ :geometry_forces_properties.png?nolink&400 |VINE PIC}} +{{geometry_forces_properties.png?nolink&400}} 
  
 Using generators as the source of the geometry requires some special consideration.  Please see the final section of this page for more information. Using generators as the source of the geometry requires some special consideration.  Please see the final section of this page for more information.
  
-===== Adding Behaviors =====+===== Adding behaviors =====
 “Behaviors” control how Branch generators react to the geometry in the force.  Options include: “Behaviors” control how Branch generators react to the geometry in the force.  Options include:
  
Line 64: Line 65:
 Geometry Forces can have multiple behaviors and which one is used is specified per generator.  Think of a scene where you have a barn, vines, and a nearby oak tree.  The idea behind behaviors is that you have one Geometry Force (the barn), then separate behaviors for things that might interact with it.  Vines might be attracted to the barn and crawl along it while oak tree branches might avoid the barn and stop if they hit it. Geometry Forces can have multiple behaviors and which one is used is specified per generator.  Think of a scene where you have a barn, vines, and a nearby oak tree.  The idea behind behaviors is that you have one Geometry Force (the barn), then separate behaviors for things that might interact with it.  Vines might be attracted to the barn and crawl along it while oak tree branches might avoid the barn and stop if they hit it.
  
-===== Using a Geometry Force =====+===== Using a geometry force =====
 Geometry forces are enabled and disabled just like any other force.  Select a generator, navigate to the “Forces” group, and enable the geometry force in the list. Below is a screenshot of the “Single Vine” generator enabling the Geometry Force named “Rook”. Geometry forces are enabled and disabled just like any other force.  Select a generator, navigate to the “Forces” group, and enable the geometry force in the list. Below is a screenshot of the “Single Vine” generator enabling the Geometry Force named “Rook”.
-{{ :geometry_forces_enabling_force_1.png?nolink&400 }}+ 
 +{{geometry_forces_enabling_force_1.png?nolink&400}} 
 The value of the property is multiplied by the Geometry Force’s strength value and applied to the branch.  If more than one behavior has been assigned to the Geometry Force, choose the desired behavior by clicking the name field on the force property and selecting it by name.  The [[kccurves|parent curve]] and [[kccurves|profile curve]] can be used to change the force’s influence on the branch in the same manner as any other property. The value of the property is multiplied by the Geometry Force’s strength value and applied to the branch.  If more than one behavior has been assigned to the Geometry Force, choose the desired behavior by clicking the name field on the force property and selecting it by name.  The [[kccurves|parent curve]] and [[kccurves|profile curve]] can be used to change the force’s influence on the branch in the same manner as any other property.
  
Line 73: Line 76:
 Once a Geometry Force obstructs any given branch, the properties in the group “Geometry Force Crawling” on the Branch generator (pictured below) control how the branch will crawl over the surface of the geometry. Once a Geometry Force obstructs any given branch, the properties in the group “Geometry Force Crawling” on the Branch generator (pictured below) control how the branch will crawl over the surface of the geometry.
  
-{{ :geometry_forces_crawling.png?nolink&400 |GEOMETRY FORCE CRAWLING PIC}}+{{geometry_forces_crawling.png?nolink&400}}
  
 These properties are explained in detail [[branch_generator|here]] but the general idea is to use these properties to convey how much the branch can bend (“Max bend angle”), how much of it can press into the mesh (“Tolerance”), how hard it tries to find a solution (“Max iterations”), how much it anticipates what it will need to do (“Look ahead”), and what it will do while it’s touching (“Follow”) group. These properties are explained in detail [[branch_generator|here]] but the general idea is to use these properties to convey how much the branch can bend (“Max bend angle”), how much of it can press into the mesh (“Tolerance”), how hard it tries to find a solution (“Max iterations”), how much it anticipates what it will need to do (“Look ahead”), and what it will do while it’s touching (“Follow”) group.
Line 82: Line 85:
  
  
-===== Using a Geometry Force to Align =====+===== Using a geometry force to align =====
 All forces have an “Align strength” property.  Any generator that enables a force will combine its own “Forces:Align” settings with the force’s “Align strength” to influence how all nodes are initially oriented.  This is different from just making them bend very early; aligning actually changes where they are attached to their parent and in what direction they point. All forces have an “Align strength” property.  Any generator that enables a force will combine its own “Forces:Align” settings with the force’s “Align strength” to influence how all nodes are initially oriented.  This is different from just making them bend very early; aligning actually changes where they are attached to their parent and in what direction they point.
  
 When a Geometry Force is used to align it will cause nodes to shift away from the geometry as much as possible at their anchor points and point away from the geometry as well.  This technique is useful, for example, to ensure ivy leaves do not cut through the wall they are growing.  All of the leaves used in the “Vines” example utilize alignment for reference. When a Geometry Force is used to align it will cause nodes to shift away from the geometry as much as possible at their anchor points and point away from the geometry as well.  This technique is useful, for example, to ensure ivy leaves do not cut through the wall they are growing.  All of the leaves used in the “Vines” example utilize alignment for reference.
  
-===== Force Attenuation =====+===== Force attenuation =====
 Attenuation applies to Geometry Forces just as it does to any other force type.  For Geometry Forces, the distance used is the distance away from the closest point on the geometry’s surface instead of the distance away from the force’s position. Attenuation applies to Geometry Forces just as it does to any other force type.  For Geometry Forces, the distance used is the distance away from the closest point on the geometry’s surface instead of the distance away from the force’s position.
  
 Both “Force:Strength” and “Force:Align strength” can be attenuated, each with their own settings.  In the example we’ve been using, the “Rook” Geometry Force does not have its main strength attenuated but does have its align strength attenuated.  This technique is used here so that the leaves are free to orient in any fashion until they get very close to the surface of the geometry. Both “Force:Strength” and “Force:Align strength” can be attenuated, each with their own settings.  In the example we’ve been using, the “Rook” Geometry Force does not have its main strength attenuated but does have its align strength attenuated.  This technique is used here so that the leaves are free to orient in any fashion until they get very close to the surface of the geometry.
  
-{{ :geometry_forces_attenuation.png?nolink&400 |}}+{{geometry_forces_attenuation.png?nolink&400}}
  
 In the screenshot above, the “Rook” geometry force is selected and the orange lines indicate the attenuation distance for alignment attenuation.  There is no main force strength attenuation on this force, but, if there were, it would be indicated by similar white lines. In the screenshot above, the “Rook” geometry force is selected and the orange lines indicate the attenuation distance for alignment attenuation.  There is no main force strength attenuation on this force, but, if there were, it would be indicated by similar white lines.
  
 =====Containers===== =====Containers=====
-{{ ::container_force.jpg?nolink&150}} 
 Similar to attenuation, forces can also have an area of effect controlled by another "container" geometry force, limiting its area of effect. You can indicate an area to be included or excluded for a particular force by setting the corresponding properties in the [[force_object#container_forces|"Container force"]] property group to the name(s) of the geometry forces you wish to use as containers. Similar to attenuation, forces can also have an area of effect controlled by another "container" geometry force, limiting its area of effect. You can indicate an area to be included or excluded for a particular force by setting the corresponding properties in the [[force_object#container_forces|"Container force"]] property group to the name(s) of the geometry forces you wish to use as containers.
  
-In the picture to the right, there are four forces: two direction forces and two geometry forces with a sphere mesh indicating the area of effect for the corresponding direction force. The branch is affected by the direction forces in a very precise manner.+In the following image, there are four forces: two direction forces and two geometry forces with a sphere mesh indicating the area of effect for the corresponding direction force. The branch is affected by the direction forces in a very precise manner. 
 + 
 +{{container_force.jpg?nolink&150}}
  
-===== Using Generators: Compute Order Matters=====+===== Using generators: Compute order matters=====
 If you’re using generators as the geometry source you must take the order in which the generators are computed into account.  In general, all of the generators that make up a Geometry Force must be computed before any generator that uses that Geometry Force.  The lone exception being that a generator is allowed to use a Geometry Force made from itself (and only itself).  This exception allows for things like roots not to intersect with each other even though they’re in the same generator. If you’re using generators as the geometry source you must take the order in which the generators are computed into account.  In general, all of the generators that make up a Geometry Force must be computed before any generator that uses that Geometry Force.  The lone exception being that a generator is allowed to use a Geometry Force made from itself (and only itself).  This exception allows for things like roots not to intersect with each other even though they’re in the same generator.
  
 The screenshot below is from the sample named “vines_on_tree.spm” in the Geometry Forces sample folder. The screenshot below is from the sample named “vines_on_tree.spm” in the Geometry Forces sample folder.
  
-{{ :geometry_forces_pass_values.png?nolink&400 |VINE TREE PIC}} +{{geometry_forces_pass_values.png?nolink&400}} 
  
 Notice that several of the vines have a “Pass” level shown next to them.  Computation is done in passes.  Each generator is in the first pass unless otherwise edited.  In this example, “Trunk and Branches” are in pass 1 (pass 1 is the default and remains unlabeled).  “Vines A” is in pass 2.  “Vines B” is in pass 3.  The computation order is as follows: Notice that several of the vines have a “Pass” level shown next to them.  Computation is done in passes.  Each generator is in the first pass unless otherwise edited.  In this example, “Trunk and Branches” are in pass 1 (pass 1 is the default and remains unlabeled).  “Vines A” is in pass 2.  “Vines B” is in pass 3.  The computation order is as follows: