Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 29 Next »

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

 

NameTypeMinMaxDefaultDescription
Materialchar*------Material name
Points per Bladeunsigned int2204Number of control points per blade
Primitive Typeunsigned int020Grass type (0: Smooth; 1: Flat; 2: Cylinder (hair)
Seedunsigned int0163830Initial seed for blades generation (useful when there are two grass modifiers in the same mesh)
Densityunsigned int11e82000Blades density (blades/m2)
Density MapCmap------Blades density texture map
Lengthfloat0.01e510.0Blade length
Length MapCmap------Blade length map
Length Variationfloat0.0100.020.0Length random variation (%)
Root Widthfloat0.11e55.0Root width in milimeters
Tip Widthfloat0.11e51.0Tip width in milimeters
Width Variationfloat0.0100.020.0Width random variation (%)
Initial Anglefloat0.090.080.0Initial blade-ground angle in degrees (º)
Initial Angle MapCmap------Initial angle texture map
Initial Angle Variationfloat0.0100.025.0Initial angle variation (%)
Start Bendfloat0.0100.040.0Start bend point (in % of blade length)
Start Bend MapCmap------Start bend texture map
Start Bend Variationfloat0.0100.025.0Start bend variation (%)
Bend Radiusfloat0.0011e510.0Bend radius in centimeters
Bend Radius MapCmap------Bend radius texture map
Bend Radius Variationfloat0.0100.025.0Bend radius variation (%)
Bend Anglefloat0.0360.080.0Bend angle in degrees (º)
Bend Angle MapCmap------Bend angle texture map
Bend Angle Variationfloat0.0100.025.0Bend angle variation (%)
Cut Offfloat100.00.0100.0Cut off point (in %)
Cut Off MapCmap------Cut off texture map
Cut Off Variationfloat0.0100.00.0Cut off variation (%)
Enable LODbyte010Enable density level of detail
LOD Min Distancefloat0.01e510.0Level of detail starting distance (in meters)
LOD Max Distancefloat0.01e550.0Level of detail end distance (in meters)
LOD Max Distancefloat0.0100.010.0Percent (%) of initial density at Max. distance
Display Percentfloat0.0100.010.0Percent (%) of blades displayed for preview purposes
Display Max. Bladesfloat0.01e51000.0Maximum amount of blades displayed for preview purposes
      
      
      
  • No labels