...
This extension enables maxwell to render particles as spheres. These particles can be stored in a .bin or .pxy file, typically saved from realflow, or passed as internal data which is stored in the .mxs file.
Besides generating its own geometry, this extension can generate also its own UV coordinates. This is done using one or more of the 39 custom UV generators available. Each particle is assigned a pair of UV coordinates whose value depends on the generator used and the mapped magnitude. To use one of the generators, create a UV channel and assign it the desired custom type.
How to create a particles object, add a uv channel, and set its custom type to "Density" (see below).
Code Block | ||||
---|---|---|---|---|
| ||||
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
float minD = 0.19;
float maxD = 1.67;
particlesParams->setFloat( "Min Density", minD );
particlesParams->setFloat( "Max Density", maxD );
//Get the number of custom generators available
byte numCustomUVGenerators = geomProcPlugin->getNumberOfUVGenerators();
Cmaxwell::Cobject obj = scene->createGeometryProceduralObject( "My Particles", particlesParams );
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.generateCustomUVW( uvIndex, 34 );//34 is the type of the custom uv generator.
|
Parameters
Name | Type | Description |
---|---|---|
char* | Particles filename | |
float | Particle radius multiplier | |
float | Motion blur multiplier | |
float | Camera shutterspeed | |
MaxwellParticles | float | Percentage of particles to load |
MaxwellParticles | unsigned int | Enables Multipoint feature |
MaxwellParticles | float | Dispersion of the extra particles cloud |
MaxwellParticles | float | Deformation of the extra particles cloud |
MaxwellParticles | byte | Load or not array of Force vectors |
"Min Force" | float | |
"Max Force" | float | |
"Load particle Vorticity" | byte | Load or not array of Vorticity vectors |
"Min Vorticity" | float | |
MaxwellParticles | float | |
"Load particle Normal" | byte | Load or not array of Normal vectors |
"Load particle neighbors no." | byte | Load or not array of particle neighbors# |
"Min Nneighbors" | unsigned int | |
"Max Nneighbors" | unsigned int | |
"Load particle UV" | byte | Load or not array of particle UV |
"Load particle Age" | byte | Load or not array of particle Age |
"Min Age" | float | |
"Max Age" | float | |
"Load particle Isolation Time" | byte | Load or not array of particle isolation time |
"Min Isolation Time" | float | |
"Max Isolation Time" | float | |
"Load particle Viscosity" | byte | Load or not array of particle viscosity |
"Min Viscosity" | float | |
"Max Viscosity" | float | |
"Load particle Density" | byte | Load or not array of particle density |
"Min Density" | float | |
MaxwellParticles | float | |
"Load particle Pressure" | byte | Load or not array of particle pressure |
"Min Pressure" | float | |
"Max Pressure" | float | |
"Load particle Mass" | byte | Load or not array of particle mass |
"Min Mass" | float | |
"Max Mass" | float | |
"Load particle Temperature" | byte | Load or not array of particle temperature |
"Min Temperature" | float | |
"Max Temperature" | float | |
"Load particle ID" | byte | Load 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 |
UV Generators
Name | Index |
---|---|
"Particle UV" | 0 |
"Particle UW" | 1 |
"Particle VW" | 2 |
"Velocity Modulus" | 3 |
"Velocity Vx" | 4 |
"Velocity Vy" | 5 |
"Velocity Vz" | 6 |
"Velocity Vx Vy" | 7 |
"Velocity Vx Vz" | 8 |
"Velocity Vy Vz" | 9 |
"Force Modulus" | 10 |
"Force Fx" | 11 |
"Force Fy" | 12 |
"Force Fz" | 13 |
"Force Fx Fy" | 14 |
"Force Fx Fz" | 15 |
"Force Fy Fz" | 16 |
"Vorticity Modulus" | 17 |
"Vorticity wx" | 18 |
"Vorticity wy" | 19 |
"Vorticity wz" | 20 |
"Vorticity wx wy" | 21 |
"Vorticity wx wz" | 22 |
"Vorticity wy wz" | 23 |
"Normal Nx" | 24 |
"Normal Ny" | 25 |
"Normal Nz" | 26 |
"Normal Nx Ny" | 27 |
"Normal Nx Nz" | 28 |
"Normal Ny Nz" | 29 |
"No. neighbors" | 30 |
"Age" | 31 |
"Isolation Time" | 32 |
"Viscosity" | 33 |
"Density" | 34 |
"Pressure" | 35 |
"Mass" | 36 |
"Temperature" | 37 |
"ID" | 38 |
"FileName"
Name of the file that contains particles data. It is a NULL terminated string.
...