Description
This extension allows to generate grass on the top of meshes. It works as a object modifier plugin. Internally it creates blades and converts them to different grass primitives depending on the user parameters.
Example of how to create a MaxwellGrass object:
// If we don't need to call functions such as CgeometryModifierExtension::getProxyDisplayPoints() // (i.e for display purposes) // then it is possible to define procedural geometries or object modifiers // without loading extension dynamic libraries (.mxx files) // but a MXparamList object can be created and filled with the desired parameters. Cmaxwell::Cobject mesh = pMaxwell->createMesh( ... ); // ...fill mesh parameters MXparamList* grassParams = new MXparamList( "MaxwellGrass" ); float bladesDensity = 500.0; grassParams->setFloat( "Density", bladesDensity ); float length = 0.25; grassParams->setFloat( "Length ", length ); grassParams->setString( "Material", materialName ); //...etc.. object.applyGeometryModifierExtension( grassParams );
Parameters
Name | Type | Min | Max | Default | Description |
---|---|---|---|---|---|
Material | char* | -- | -- | -- | Material name |
Density | unsigned int | 1 | 1e8 | 2000 | Blades density (blades/m2) |
Density Map | Cmap | -- | -- | -- | Blades density texture map |
Length | float | 0.0 | 1e5 | 10.0 | Blade length |
Length Map | Cmap | -- | -- | -- | Blade length map |
Length Variation | float | 0.0 | 100.0 | 20.0 | Length random variation (%) |
Root Width | float | 0.1 | 1e5 | 5.0 | Root width in milimeters |
Tip Width | float | 0.1 | 1e5 | 1.0 | Tip width in milimeters |
Width Variation | float | 0.0 | 100.0 | 20.0 | Width random variation (%) |
Initial Angle | float | 0.0 | 90.0 | 80.0 | Initial blade-ground angle (in degrees) |
Initial Angle Map | Cmap | -- | -- | -- | Initial angle texture map |
Initial Angle Variation | float | 0.0 | 100.0 | 25.0 | Initial angle variation (%) |