![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> It depends what you mean as cyiptic.
>
> ABX
Oops, I meant "cryptic".
--
Jonathan.
Home: http://digilander.iol.it/jrgpov
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Wed, 3 Apr 2002 15:38:09 -0600, "Shay" <sah### [at] simcoparts com> wrote:
> Thanks, guys. I'm going to have to time the workaround against a macro. I am
> thinking of building combination fractal / 3D knots so speed is a very
> important consideration.
// at first you have to code functions for each component of your vector
// sample operations attached
#local f_X = function ( float ) { float };
#local f_Y = function ( float ) { float/2 };
#local f_Z = function ( float ) { float/3 };
// then you have to bound possible results
// bounding can be pretty large but remember about accuracy problem
#local X_Min = -10000;
#local X_Max = 2560;
#local Y_Min = 1000;
#local Y_Max = 1280;
#local Z_Min = 1000;
#local Z_Max = 3300;
// then you have to calculate ranges of coordinates
#local X_Range = X_Max - X_Min;
#local Y_Range = Y_Max - Y_Min;
#local Z_Range = Z_Max - Z_Min;
// now create pigment inside ranges
// our float is supposed to be at x coordinate position
#local P = pigment{
average
pigment_map{
[
1
function { ( f_X(x) - X_Min ) / X_Range }
color_map { [0 red 3*X_Min] [ 1 red 3*(X_Range+X_Min) ] }
]
[
1
function { ( f_Y(x) - Y_Min ) / Y_Range }
color_map { [0 green 3*Y_Min] [ 1 green 3*(Y_Range+Y_Min) ] }
]
[
1
function { ( f_Z(x) - Z_Min ) / Z_Range }
color_map { [0 blue 3*Z_Min] [ 1 blue 3*(Z_Range+Z_Min) ] }
]
}
};
// now convert pigment to function
#local F=function{pigment{P}};
// finally call function putting float at x position and putting anything
// (for example 0) at x and y position
#local V = F(300,0,0);
// remember result is 5D vector (color) so before use as 3D recconvert it
#include "strings.inc"
#warning VStr( <V.x,V.y,V.z> )
// ABX
// I hope I will be considered as the father of this method ;-)
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Wed, 3 Apr 2002 23:42:36 +0200, "JRG" <jrg### [at] hotmail com> wrote:
> Oops, I meant "cryptic".
It depends what you mean as cryptic.
Anyway code after moment in this thread so You'll see it is cryptic or not.
ABX
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
wrote:
> #local X_Min = -10000;
> #local X_Max = 2560;
> #local Y_Min = 1000;
> #local Y_Max = 1280;
> #local Z_Min = 1000;
> #local Z_Max = 3300;
should be rather
#local X_Min = -10000;
#local X_Max = 2560;
#local Y_Min = -1000;
#local Y_Max = 1280;
#local Z_Min = -100;
#local Z_Max = 3300;
ABX
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
>
><snip>
> should be rather
> <snip
>
> #local Z_Min = -100;
Z = -1000?
The only part of your process that I do not understand is the bounding
process. Are the bounds chosen arbitrarily, or is there a method for
assigning bounds?
-Shay
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Never mind. I just figured it out.
Shay <sah### [at] simcoparts com> wrote in message
news:3cab8298$1@news.povray.org...
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Wed, 3 Apr 2002 16:31:50 -0600, "Shay" <sah### [at] simcoparts com> wrote:
> The only part of your process that I do not understand is the bounding
> process. Are the bounds chosen arbitrarily, or is there a method for
> assigning bounds?
Bounding is necessary to rescale value from space to 0-1 entry for color map in
color component and then rescale back to original value. Every scaling requires
origin of scaling and scale value - here they are min and range value.
Presented values are randomly choosed without any important rule. My suggestion
is to use something like:
#local X_Max = 1e5;
#local X_Min = -X_Max;
and the same for Y and Z.
You have to remember that outside bounding results can be wrong.
ABX
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
I'm going to time this method tonight against <get_x, get_y, get_z> and
macro.
I will post the results tomorrow.
I understand why you are scaling the results to an appropriate range for the
color map, but is it really necessary. Can a pigment function not return
values greater than 1 for a hue? I know that Povray will accept {rgb
<100,30,80>} or even {rgb <-1,-1,-1>}. Does a pigment function behave
differently? I will test this tonight.
-Shay
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Wed, 3 Apr 2002 17:00:25 -0600, "Shay" <sah### [at] simcoparts com> wrote:
> I understand why you are scaling the results to an appropriate range for the
> color map, but is it really necessary. Can a pigment function not return
> values greater than 1 for a hue?
Pigment can return values greater than 1. My methor return values greater than
1. Only problem is that map entries are placed along <0,1> range.
ABX
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Wed, 3 Apr 2002 17:00:25 -0600, "Shay" <sah### [at] simcoparts com> wrote:
> I understand why you are scaling the results to an appropriate range for the
> color map, but is it really necessary.
'6.7.1.3 Color Maps' second paragraph
ABX
--
disc{z,-z#macro O()asc(substr("-+((1*(,1,/.-,*/(,&.323/'1"e,1))*.1-4#declare
e=e-1;#end#local e=26;5pigment{#local g=function(_){ceil(_)-_}function#local
k=function{pattern{object{sphere_sweep{linear_spline 13#while(e)<O(),O()//35
>.01#end}}}}{k(g(atan2(x,y)),g(ln((y+x)^2+1e-5)),0)}}finish{ambient 1}}//ABX
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |