gmask
01-03-2008, 01:08 AM
I'm trying to figure out a way to "displace" vertices in a polygonal plane using an animated texture map. I don't want to use a shader and a displacement because I need to see geometry actually get moved in the interface. The code below sor tof works although it spits out alot of errors about some objects not being movable in 3d space which is annoying.
I thought I might beable to do this with artisan in some way but the artPuttyCtx command is only for NURBS.. but I might beable to use it if I could figure out how to use it to just load an image and displace it and then convert it to polygons.
select -r pPlane1;
$x = `polyEvaluate -uv`;
int $N = 0;
while($N <= $x[0]){
select -r pPlane1.vtx[$N];
PolySelectConvert 4;
float $uvPos[] = `polyEditUV -q`;
$color = ` colorAtPoint -o RGBA -u ($uvPos[0]) -v ($uvPos[1]) ramp1`;
select pPlane1.vtx[$N];
move -a -y $color[0]`;
$N++;
}
I thought I might beable to do this with artisan in some way but the artPuttyCtx command is only for NURBS.. but I might beable to use it if I could figure out how to use it to just load an image and displace it and then convert it to polygons.
select -r pPlane1;
$x = `polyEvaluate -uv`;
int $N = 0;
while($N <= $x[0]){
select -r pPlane1.vtx[$N];
PolySelectConvert 4;
float $uvPos[] = `polyEditUV -q`;
$color = ` colorAtPoint -o RGBA -u ($uvPos[0]) -v ($uvPos[1]) ramp1`;
select pPlane1.vtx[$N];
move -a -y $color[0]`;
$N++;
}
