Use VEX to create a point cloud geometry opertator.
Sliding particles and point clouds.
Date Created:Friday December 29th, 2006 03:41 AM
Date Modified:Thursday July 31st, 2008 12:11 AM

#pragma hint filename oppath
#pragma hint height hidden
sop
getColor(string filename="/obj/model/popnet1";
export float height = 0;
float radius = 1;
float falloff = 1;)
{
string file = concat("op:", filename);
// may want to change this...npoints in vex looks at opinputs
int numpoints = npoints(filename)+10;
int pointcloud = pcopen(file, "P", P, radius, numpoints);
Cd = 0;
while(pciterate(pointcloud))
{
float dist;
vector col;
pcimport(pointcloud, "point.distance", dist);
pcimport(pointcloud, "Cd", col);
float dd = dist/radius;
// actually a smooth function
// smooth(0,1,dd);
// 3x^2 - 2x^3
dd = 3 * ( dd * dd ) - 2 * ( dd * dd * dd);
dd = pow(dd,falloff);
Cd += col * ( 1 - dd ) ;
}
}
Downloads:
Download: contact.swf 397 KB
Download: point_cloud_xmas.vfl 900 B
Download: pointcloudchristmassops.hip 467 KB
Please login or Click Here to register for downloads
Point Cloud Christmas by Dan Lynch
is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
Based on a work at www.3daet.com
Permissions beyond the scope of this license may be available at http://www.3daet.com
