Scene Setup
Required element for this setup |
|
Objects needed:
Get a
grid, by default its name is
grid
Create a
Cube, by default its name is
cube
Get an empty
pointcloud, by default its name is
pointcloud.
|
Getting an ICETree |
|
Steps:
Select the
pointcloud, and hit
Alt+9.
An ICETree editor will be opened
To start building the ICETree graph, make sure that pointcloud is in the right pane.
Click ICETree->Create->ICE Tree
There will be a single ICETree node created in the editor which will be the
root of the ICETree graph
|
Get Location on the Surface |
|
There might be several ways to get Location on Surface, here is an example of setting up options for user to choose:
- Use Raycast method
- Use Get Closest Location method
Each method will give different result.
Raycast method
Notes:
- Raycast node has 2 output port, Location and Hit
Location : Location at which the ray hit the surface.
Hit
: A Boolean indicating whether the ray actually hit the surface.
Location
information can be used to get other information such as PointPosition, PointNormal etc.
- Important value in Raycast node is
Direction
Directiom
: The direction of the ray as 3D Vector
Get Closest Location method
Notes:
- Get Closest Location node has 2 output, Location and Found
Location : Location at the surface which has the shortest distance to input Position
Found : A Boolean indicating whether the location was found in the Cutoff Distance.
Location
information can be used to get other information such as PointPosition, PointNormal etc.
Looking at those graph we found similarity on both input and output port, this suggest that it maybe worthed to combine those graph as a single graph sharing the input and output.
|
Creating Get Surface Location Compound |
|
Combining the methods
Since we are planning to create a compound out of the ICEGraph, it's worthed to minimize exposed port whenever it is possible using Pass Through nodes.
Notes:
- With Pass Through node, a single port can be exposed but connect the exposed port to multiple nodes
- Using Select Case, select the output of multiple nodes and output a single result depend on Condition.
It is similar with using Switch/Case statement in JScript
- Condition input port of Select Case node is an integer, and path to be processed named accordingly, for example
- Condition value = 0, will use Case0 path
- Condition value = 1, will use Case1 path
- Condition value = N, will use CaseN path
|
|
Creating the Compound
Add 2 Get Data Node, and connect both Source input port to Result output port of Select Case node that connected to Location, and
- Set one to get PointPosition
- Set the other to get PointNormal
Select all nodes except "Get grid" and "Get cube.kine.global", and use ICETree->Compound->Create Compound.
Customize the Compound
Notes:
- Expose ports and give descriptive name for those ports.
And if necessary also use other properties such as using combo box.
- For example, for the Geometry Query input box, instead of having integer for Condition,
use "Raycast" and "Closest Location" is more helpful for user.
- When user select "Raycast" it will pass 0 to the Pass Through node,
and when user select "Closest Location" it will pass 1
|
Solving Constraint Position |
|
Coming Soon
Notes:
|
Aligning Rotation to Surface Normal |
|
Coming Soon
Notes:
|
Adding Option for Constraining Rotation |
|
To let user decide whether they want to constraint the rotation to surface normal or not, we need to add an
If node to the tree.
Coming Soon
Notes:
|
Adding Option for Constraint Position |
|
Let user choose the constraint position behaviour
Coming Soon
Notes:
|
Beyond this tutorial.
|
|
Cheers,
|