This modifier implements a sheet of triangles. While this is a modifier, the term "primitive" is used throughout its implementation because this modifier creates geometry instead of modifying anything.
Please right click to download source code for this example.
This modifier is simple to understand. The data interface implements accessor functions for each unique parameter. Since this modifier requires additional parameters, a property sheet is implemented. This modifier uses a TransformExecutionModule to implement handle transformations to the geometry in conjunction with other modifiers in the construction history. The create command is implemented via script in modifier_scripts.ssl
The algorithm used to create the geometry is simple. First the vertices are created, followed by the edges. Then the connected mesh is formed. Specific steps in this algorithm are as follows:
This modifier introduces the concept of handles. Handles are selectable drawing guides used to provide worksheet-based control for the size of the rectangle sheet. In large terrain scenes, where precision is required, using handles is impractical. However in smaller scenes handles are perfectly practical.
NOTE: Any modifier or draw mode can implement interactive handle picking. However the use of a mesh construction history introduces complications. If you implement handles for each modifier, how do you know which handle to select for a given mesh with an unknown quantity of modifiers? Where should you position each handle? What if handle positions overlap? The obvious solution is to allow the user to display each handle separately but that has additional workflow issues, specifically, disruptions to operational fluidity. At present Scenome uses scriptable, interactive draw modes to implement worksheet/mouse-based "tweaking" for any parameter of any node.
Handle picking is implemented in the source file ModifierPickModule.cpp. This works in conjunction with the system RenderFeedBack. The RectanglePrimitive source file includes the RenderFeedBack system. More generically, this implements surface, line, and point "feedback-based" selection which enables very high-precision selection operations.