Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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:

Code Block
languagecpp
linenumberstrue
// 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

 

""""""""" Map"Length density " Variation" bytefloatfloatbytebyteunsigned intunsigned int
NameTypeMinMaxDefaultDescription
Material
char*------Material name
Density
unsigned int11e82000Blades density (blades/m2)
Density Map
Cmap------Blades density map
Length
float0.01e510.0Blade length
Length
mapCmap------
Blade length map
Length
variationfloat0.0100.020.0Length random variation (%)
 float    
 float  
  
    
 
     
     
 
    
  
   
   
  
    
 float    
 stesttes   
 asdasdfasfdfdfl kaldfla df;l af;la dfa;lkj
      

asdga

...

 

"FileName"

Name of the file that contains particles data. It is a NULL terminated string.

...