|
|
Am 26.04.2018 um 21:44 schrieb Bald Eagle:
>> Perhaps if the existing POV-Ray internal function code were posted here, that
>> would provide a good jumping-off point?
>
> Good idea Bill, get on that, will you?
> Right.
> Here ya go.
>
> From fnintern.cpp
>
> DBL f_hex_x(FPUContext *ctx, DBL *ptr, unsigned int fn); // 27
> DBL f_hex_y(FPUContext *ctx, DBL *ptr, unsigned int fn); // 28
"These are not the functions you are looking for."
To the best of my knowledge, those functions actually correspond to the
`tiling 2` pattern, not the `hexagon` pattern.
The `hexagon` pattern is implemented by `HexagonPattern::Evaluate()` in
`source/core/material/pattern.cpp` (approx. line 6510).
Note however that the function is implemented using imperative
programming, and needs to be re-formulated as a pure function in order
to implement it as an SDL function.
Also, the function returns values 0, 1 or 2 to select the texture,
whereas a function to be used in a function-based pigment needs to
return values in the rang 0..1 (e.g. 0/N, 1/N, 2/N, ..., N/N) to select
the texture from a texture map.
Post a reply to this message
|
|