> If I were to initialize my vectorlist before we start shooting rays, and > leave it prepared so that each call of hit() is able to access this list, > where and how should I do it?
It depends. If we’re talking about the material objects concept, they would auto-load during database traversal (during raytrace prep). You would probably want to stash a pointer to the container during view_init() or view2_init() so you could access it during hit(). > Might it be that the ray-shoots happen inside some loop in worker.c? Yes. > Is it a general purpose code that is used for all ray-tracing programs? If > so, how does it know which hit() function to call (rtweight, rt…). Yes, it’s general purpose so all programs behave the same, take the same options, etc. Each program only links against a single view*.c so there is only one hit() function. > Trying to rescue this one comment you made a few weeks ago: [snip] > How exactly would we approach this? "Distance to the vector" makes little > sense to me. Do you mean distance between the points? (as in, point b is > closer to point B than it is to point A, so it gets more influence from it's > vector). Not the distance between points, but distance to their transition vectors. From the prior e-mail, the way this should fully generalize can be handled by projecting points onto the ray, and projecting any transition vectors onto the ray. Then for a given ray, it can fully handle just about any transition type. To see how this will work, it will likely be necessary to redo rtexample and get 2-points working without any vectors. You project each point onto the ray. ptA ptB | | IN v v OUT ray o--ptA'----ptB'---o Density from IN to ptA’ is density(ptA). Density from ptB’ to OUT is density(ptB). Density from ptA’ to ptB’ is density(ptA) until the midpoint between ptA’ and ptB’. Thus the section’s average density would be density(ptA)/2 + density(ptB)/2. There are macros in include/vmath.h and functions in include/bn/* that help with projecting points and vectors onto other vectors (or rays). Cheers! Sean ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ BRL-CAD Developer mailing list brlcad-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-devel