alinakipoglu

alinakipoglu

About Me

Connect

LOCATION
Not Specified
ウェブサイト

Houdini Engine

Availability

Not Specified

Recent Forum Posts

Generate voxel volume of mesh (HDK) 2013年2月28日10:58

Ok! Got it. You can find procedure below. It will convert meshes into fog volumes.


OP_ERROR SOPNODE::cookMySop( OP_Context &context_ )
{
if( lockInputs( context_ ) >= UT_ERROR_ABORT )
{
return error();
}

duplicateSource( 0, context_ );

UT_BoundingBox bbox;
GU_SDFParms sdfParms;
GU_SDF sdf;

gdp->getBBox( &bbox );

sdfParms.setMode( GU_SDFParms::RAY_INTERSECT );
sdfParms.setDivisions( 100, 100, 100 );
sdfParms.setBBox( bbox );
sdfParms.setLaserScan( true );
sdfParms.setFixSigns( true );
sdfParms.setSweepCount( 3 );
sdfParms.setSweepThreshold( 2.0f );

sdf.build( gdp, sdfParms );

gdp->clearAndDestroy();

GU_PrimVolume *volumePtr = (GU_PrimVolume *)GU_PrimVolume::build( gdp );

UT_VoxelArrayIteratorF vit;
vit.setArray( sdf.getFunction() );

for( vit.rewind(); !vit.atEnd(); vit.advance() )
{
vit.setValue( vit.getValue() <= 0.0f ? 1.0f : 0.0f );
}

volumePtr->setVoxels( sdf.getFunction() );

unlockInputs();

return error();
}

Generate voxel volume of mesh (HDK) 2013年2月28日4:41

Im still looking for insights :roll:

Generate voxel volume of mesh (HDK) 2013年2月27日4:48

anybody knows something about GU_SDF?