It might sound very strange, but the script is doing what's supposed to: "Returns a list of faces not occluded, with normal facing camera direction". The faces that appear to be not selected in the farther end of the bent tube are actually occluded by the faces of the part of the tube closer to the camera. If a ray, cast…
Thanks, I am glad it helped. There is a bug in the code. I assumed the center of the polygons is within the polygon face (as happens for meshes) but it is incorrect. I commented the test of the center of the face for now. I am going to fix it later. The script is still working anyway, just a little less accurate. Cheers
With help from someone at work I've kind of got it working. Ran the script and then put "getFrontFaces $ steps:5" (or variations of the steps integer) into the maxscript listener. It does a reasonable job but is still missing random faces that are obviously visible (ie not just small faces on the objects outline that…
Hi all, This seems to be an issue lots of people have asked about online but I've yet to find a solution. I have a bunch of objects that I've dynameshed and decimated in zbrush, and now I need to optimise based on a camera position. i.e. select all faces visible to the camera and delete the rest. Ignore backfacing isn't…
Ah, yeah, that's right. I got the impression that this script would behave that way. Not sure why it would be missing completely un-occluded faces on the more complex meshes I tried earlier today. Really appreciate the help by the way. I wish autodesk would just implement Mayas camera based selection :(
Hi, here is the script you're looking for (hopefully :) It is not super tested (it's late). It works on Editable Polys and select all the faces visible from camera in the active viewport. It is a function and a call on the selected node, I think you should be able to run it. ( function getVisiblePolys theEditablePoly…
Thanks for the help SyncViewS. I've got it working but as you said, the missed faces are still present. On the basic shape I'm testing on now I get the same results with 50 steps as I do with 1. I don't suppose there's a way to increase the number of rays that are cast? Speed hasn't been a problem so far as long as I keep…
Hi, the function has gone missing in a website update somewhere. I've rewritten it on the fly and it should do the job. It is required only if the object is an Editable Poly, the Editable Mesh doesn't call it. [html]function getPolyFromMeshFace theEditablePoly iMeshFace = ( local iResultPoly = 0 if (…
If I remember correctly, that "steps" parameter is the subdivision of each edge of each face that becomes a ray generator to cast on the possibly occluded meshes (I might be wrong). Increasing it, should do more raycasts. Have you fiddled with these variable at the beginning of the script? local fDotThresh = 1e-3 local…
I haven't tried altering any of the values, as I said, I haven't the foggiest when it comes to maxScript I'm afraid. I can show you the basic noisy mesh test I'm doing which would be very easy to fix by hand, but the project I need this for would take a loooong time to sort by hand (sorry, can't show you the meshes I need…