Versions Compared

Key

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

...

Code Block
languagecpp
linenumberstrue
CextensionManager* extensionManager = CextensionManager::instance();
CgeometryProceduralExtension* geomProcExtension = extensionManager->createGeometryProceduralExtension( "MaxwellParticles" );
//Get the extension container. When using this method of getting the container,
//nearly all parameters have default values, and there is no need to explicitly set them.
MXparamList* particlesParams = geomProcExtension->getExtensionData();

//Fill the required data
char* filename = "/home/rocco/Emitter01_00023.bin";
particlesParams->setString( "FileName", filename );

//Enable loading particle densities data
byte load = 1;
particlesParams->setByte( "Load particle Density", load );

//These two numbers can be obtained parsing the particles file or all the particles sequence
//They're needed to map the values of densitiesvelocities from 0.0 to 1.0 to access the texture.
float minDminV = 0.190;
float maxDmaxV = 123.67;
particlesParams->setFloat( "Min DensityVelocity", minDminV );
particlesParams->setFloat( "Max DensityVelocity", maxDmaxV );

//GetAdd the numberprocedural ofobject customto generators available
byte numCustomUVGenerators = geomProcPlugin->getNumberOfUVGenerators();the scene
Cmaxwell::Cobject obj = scene->createGeometryProceduralObject( "My Particles", particlesParams );

dword uvIndex;//Let´s add a uv channel...
dword uvIndex;//returned uv channel index. Use this index in the texture map properties to access its uv's
byte isOk = obj.addChannelUVW( uvIndex );= obj.addChannelUVW( uvIndex ); // uvIndex will be set to the actual uv channel number of the object.
//...and set it to a custom UV generator, 3, in this case, velocity modulus
obj.generateCustomUVW( uvIndex, 343 );//343 is the type of the custom uv generator.

//Now assign a material and set the first BSDF reflectance0º color a texture driven by uv channel 'uvIndex'
 

...


//This uv channel, since it is a one-valued channel, stores its value in the U coordinate.

 

Parameters

 

Name

Type

Description

"FileName"

char*

Particles filename

"Radius Factor"

float

Particle radius multiplier

"MB Factor"

float

Motion blur multiplier

"Shutter 1/"

float

Camera shutterspeed

"Load particles %"floatPercentage of particles to load
"Create N particles per particle"unsigned intEnables Multipoint feature if N > 0
"Extra particles dispersion"floatDispersion of the extra particles cloud
"Extra particles deformation"floatDeformation of the extra particles cloud
"Load particle Force"byteLoad or not array of Force vectors
"Min Force"floatMinimum force modulus value
"Max Force"floatMaximum force modulus value
"Load particle Vorticity"byteLoad or not array of Vorticity vectors
"Min Vorticity"floatMinimum vorticity modulus value
"Max Vorticity"floatMaximum vorticity modulus value
"Load particle Normal"byteLoad or not array of Normal vectors
"Load particle neighbors no."byteLoad or not array of particle neighbors#
"Min Nneighbors"unsigned intMinimum number of neighbors value
"Max Nneighbors"unsigned intMaximum number of neighbors value"Max Nneighbors"
"Load particle UV"byteLoad or not array of particle UV
"Load particle Age"byteLoad or not array of particle Age
"Min Age"floatMinimum age value
"Max Age"floatMaximum age value
"Load particle Isolation Time"byteLoad or not array of particle isolation time
"Min Isolation Time"floatMinimum isolation time value
"Max Isolation Time"floatMaximum isolation time value
"Load particle Viscosity"byteLoad or not array of particle viscosity
"Min Viscosity"floatMinimum viscosity value
"Max Viscosity"floatMaximum viscosity value
"Load particle Density"byteLoad or not array of particle density
"Min Density"floatMinimum density value
"Max Density"floatMaximum density value
"Load particle Pressure"byteLoad or not array of particle pressure
"Min Pressure"floatMinimum pressure value
"Max Pressure"floatMaximum pressure value
"Load particle Mass"byteLoad or not array of particle mass
"Min Mass"floatMinimum mass value
"Max Mass"floatMaximum mass value
"Load particle Temperature"byteLoad or not array of particle temperature
"Min Temperature"floatMinimum temperature value
"Max Temperature"floatMaximum temperature value
"Load particle ID"byteLoad or not array of particle ID
"PARTICLE_POSITIONS"float*Array of particle positions
"PARTICLE_SPEEDS"float*Array of particle speeds
"PARTICLE_RADII"float*Array of particle radii
"PARTICLE_IDS"int*

Array of particleID's

...