>
> I think you’re right on track. Your stubs in the code ( *_FACTOR and
> MAT_DENSITY) naturally lend themselves to substitution with a function, and
> implementing those functions figuring that out from your density_point
> structure next would be a good progression. I’d suggest starting with 0
> points, 1 point, 2 points, etc.
>
Cool! Hopefully this will be somewhat ready for monday.
> Note that currently, what is stored on disk is a material ID number (an
> integer). There’s a mapping of integers to floating point density values
> and text string descriptions (example at http://brlcad.org/~sean/dot
> density ) which is what rtweight uses. The gqa tool has the user import
> the text file into the .g file, but it’s still basically a map<int,
> pair<double, string> >.
>
> Probably a good time to revisit the big picture now that there’s more
> familiarity with terminology:
> http://brlcad.org/wiki/Density_functions
> http://brlcad.org/wiki/Material_and_Shader_Objects
>
Should we try to put our new density structure inside the .g database
directly? This can be delayed until things start working and we know how we
are gonna store our data but it would definitely kill two birds with one
stone.
> The one in the source top-level.
>
Aaah I was looking for TODO notes inside the code. Found it, thank you!
> For 0 and 1 points, there are no vectors. When you get to 2 points, you
> can just create a vector from one to the other (and your function can
> simply calculate it’s distance to each to know where it is in the gradient).
>
If we let the user define a "base" density (lets say at the origin or
something) then 1 point would already mean a vector (from origin to that
point, forming a gradient). If we don't do it, then 0 points make no sense
since we would have no density information at all, right?
I think we can already handle up to three vectors since it would mean
applying what we drafted in the examples I sent previously. Basically
calculating contributions and joining them (using average for now, more
complex methods in the future). I'll start with only one vector though, as
you suggest.
Mario.
------------------------------------------------------------------------------
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