Point selection under specific parameters



  • On 17/08/2016 at 12:43, xxxxxxxx wrote:

    Hello,

    I'm trying to figure out a way to make a point selection in an object based on a parameter and I thought it could be achieved with python. For example: I have a scene with and object and a light and I want to select only the points in my object that are being hit by the light. Is this possible?

    Thank you all.



  • On 18/08/2016 at 03:15, xxxxxxxx wrote:

    Hi,

    welcome to the Plugin Café forums 🙂

    We are not sure, if you are looking for somebody to develop such a plugin for you (as the chosen sub-forum suggests) or if you are seeking advice on how to achieve something like this yourself?

    In the later case, I'd move your thread into the Python sub-forum, just let me know.

    If anybody wants to dive into this, here are a few infos to start with:
    Selecting points of a PolygonObject is just a matter of editing the selection BaseSelect, retrieved by GetPointS() from a PointObject (where the PolygonObject is derived from).

    The harder part is of course finding the points to select.

    The simplest (but in the end not entirely correct for all shapes of objects) solution would be to just check the normals (either poly or vertex) are facing the light. NormalTag or CalcFaceNormal() (which is unfortunately missing in Python currently) would be start points here. There's also a manual about the NormalTag in our C++ documentation.

    In order to get a more correct solution (like hard shadows, including selfshadowing and occlusion by other objects) it can get way more complex. I'd start looking into the GeRayCollider for this.


Log in to reply