Houdini PointCloud Research

pointcloud which used in scatter light,particles operation,a part of shaders use this method...

so i give this source code ,it's can help someone to understand. 


below:this is a pointcloud occ source code

surface
poincloudocc(vector occcolor={1,1,1};string wpt="";string operator="writemodel";string ptx="";float srd=20;int npt=3;int samples=50)
{   

    if(operator=="writemodel")//if the write model
{   
   vector xn=wo_nspace(N);
   vector xp=wo_space(P);
   pcwrite(wpt,"P",xp,"N",xn);
   Cf={1,0,0};
}
else
{
   vector pp,pn,tempcl;
   vector tempocc;
   int handel=pcopen(ptx,"P",wo_space(P),"N",wo_nspace(N),srd,npt);
    while(pcunshaded(handel,"tempocc"))
    {      
            pcimport(handel,"P",pp);pp=ow_space(pp);
            pcimport(handel,"N",pn);pn=ow_nspace(pn);
            tempcl=occlusion(pp,pn,"bias",0.005,"maxdist",-1,"background",occcolor,"samples",samples);
            pcexport(handel,"tempocc",tempcl);
           
    }
    Cf=vector(pcfilter(handel,"tempocc"));
}

你可能感兴趣的:(Houdini PointCloud Research)