I'm trying to make point based occlusion by passing in occlusion to the point cloud as a variable and then filtering it out to use later. The point cloud gets created but when I use the VEX notation of
$success = pcwrite($file, "occ", $occlusion, "P", P, "N: Vector", N);
The point cloud gets twisted and inverted and lovely like the image to the left. This happens even when the code is simple like:
$success = pcwrite($file, "P", P, "N: Vector", N);
as it is in the actual pcwrite node. I found a pcwrite node that someone else made here, but the code is the same, just containing five elements. I may end up just using that until I can figure out why mine doesn't work.
$success = pcwrite($file, "occ", $occlusion, "P", P, "N: Vector", N);
The point cloud gets twisted and inverted and lovely like the image to the left. This happens even when the code is simple like:
$success = pcwrite($file, "P", P, "N: Vector", N);
as it is in the actual pcwrite node. I found a pcwrite node that someone else made here, but the code is the same, just containing five elements. I may end up just using that until I can figure out why mine doesn't work.
Apparently the points need to be forced into world space. I must not've had the nodes hooked up correctly but the code
$success = pcwrite($file, "P", ptransform("space:world", P), "N: Vector", N);
works just fine.