![](/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) |
Am 19.08.2013 00:01, schrieb Ger Remmers:
> On 08/18/2013 04:48 PM, clipka wrote:
>> Am 18.08.2013 23:08, schrieb Ger Remmers:
>>
>>> (*) Povray seems to have a problem with very large arrays. I can go as
>>> high as 800K nodes, after that the last position in the array seems to
>>> get corrupted.
>>
>> Obviously that shouldn't happen. Can you provide a sample scene to
>> reproduce, dissect and debug the problem?
>>
>
> It messes up in the WriteDataFile() macro
Thanks, I'll have a closer look at it.
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) |
> #declare Cut = object { CuttingPlane translate y * Displacement
> rotate <AngleX, AngleY, AngleZ> };
...
> #declare PlaneAngleX = rand(RandAngle) * 360;
> #declare PlaneAngleY = rand(RandAngle) * 360;
> #declare PlaneAngleZ = rand(RandAngle) * 360;
On a separate note, are you sure that method of choosing the plane
orientation gives a uniform random distribution...?
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) |
Am 19.08.2013 14:55, schrieb scott:
>> #declare Cut = object { CuttingPlane translate y * Displacement
>> rotate <AngleX, AngleY, AngleZ> };
>
> ....
>
>> #declare PlaneAngleX = rand(RandAngle) * 360;
>> #declare PlaneAngleY = rand(RandAngle) * 360;
>> #declare PlaneAngleZ = rand(RandAngle) * 360;
>
> On a separate note, are you sure that method of choosing the plane
> orientation gives a uniform random distribution...?
#declare Cut = object { CuttingPlane translate
VRand_On_Sphere(RandAngle) * Displacement };
should do the trick.
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 08/19/2013 07:55 AM, scott wrote:
>> #declare Cut = object { CuttingPlane translate y * Displacement
>> rotate <AngleX, AngleY, AngleZ> };
>
> ....
>
>> #declare PlaneAngleX = rand(RandAngle) * 360;
>> #declare PlaneAngleY = rand(RandAngle) * 360;
>> #declare PlaneAngleZ = rand(RandAngle) * 360;
>
> On a separate note, are you sure that method of choosing the plane
> orientation gives a uniform random distribution...?
>
No, it does not, but doing it this way gives a better result than using
a single rand() for the plane orientation.
--
Cheers
Ger
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 08/19/2013 09:47 AM, clipka wrote:
> Am 19.08.2013 14:55, schrieb scott:
>>> #declare Cut = object { CuttingPlane translate y * Displacement
>>> rotate <AngleX, AngleY, AngleZ> };
>>
>> ....
>>
>>> #declare PlaneAngleX = rand(RandAngle) * 360;
>>> #declare PlaneAngleY = rand(RandAngle) * 360;
>>> #declare PlaneAngleZ = rand(RandAngle) * 360;
>>
>> On a separate note, are you sure that method of choosing the plane
>> orientation gives a uniform random distribution...?
>
> #declare Cut = object { CuttingPlane translate
> VRand_On_Sphere(RandAngle) * Displacement };
>
> should do the trick.
>
Using 3 separate rand()'s gave me a better result than a single rand(),
but by no means uniform. But then again, that was not the problem I was
trying to solve :)
--
Cheers
Ger
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) |
Ger <ger### [at] no spam thank you> wrote:
> >> #declare PlaneAngleX = rand(RandAngle) * 360;
> >> #declare PlaneAngleY = rand(RandAngle) * 360;
> >> #declare PlaneAngleZ = rand(RandAngle) * 360;
> >
> > On a separate note, are you sure that method of choosing the plane
> > orientation gives a uniform random distribution...?
> No, it does not, but doing it this way gives a better result than using
> a single rand() for the plane orientation.
Better in what way?
--
- Warp
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 08/19/2013 10:51 AM, Warp wrote:
> Ger <ger### [at] no spam thank you> wrote:
>>>> #declare PlaneAngleX = rand(RandAngle) * 360;
>>>> #declare PlaneAngleY = rand(RandAngle) * 360;
>>>> #declare PlaneAngleZ = rand(RandAngle) * 360;
>>>
>>> On a separate note, are you sure that method of choosing the plane
>>> orientation gives a uniform random distribution...?
>
>> No, it does not, but doing it this way gives a better result than using
>> a single rand() for the plane orientation.
>
> Better in what way?
>
More uniform, but in all honesty, that was not the first thing I was
paying attention to. I'll run a single vs triple rand() test case later.
--
Cheers
Ger
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) |
Ger <ger### [at] No Spam thank you> wrote:
> On 08/19/2013 10:51 AM, Warp wrote:
> > Ger <ger### [at] no spam thank you> wrote:
> >>>> #declare PlaneAngleX = rand(RandAngle) * 360;
> >>>> #declare PlaneAngleY = rand(RandAngle) * 360;
> >>>> #declare PlaneAngleZ = rand(RandAngle) * 360;
> >>>
> >>> On a separate note, are you sure that method of choosing the plane
> >>> orientation gives a uniform random distribution...?
> >
> >> No, it does not, but doing it this way gives a better result than using
> >> a single rand() for the plane orientation.
> >
> > Better in what way?
> >
> More uniform, but in all honesty, that was not the first thing I was
> paying attention to. I'll run a single vs triple rand() test case later.
>
> --
> Cheers
> Ger
My method was to choose random Phi and Theta for spherical coordinates:
#for(I, 0, 30, 1)
#local Phi = Rand_Gauss(0.0, 0.33, RdmA)*180;
#local Theta = Rand_Gauss(0.0, 0.33, RdmB)*180;
intersection {
sphere { 0.0, 3.0 }
plane { <sin(Phi)*cos(Theta), sin(Phi)*sin(Theta), cos(Phi)>, 0 }
pigment { White }
translate <-15*6 + I*6, 0, 0>
}
#end
if you want to avoid the flaw with hemispherical slices, then you also need a
random offset:
#for(I, 0, 30, 1)
#local Phi = Rand_Gauss(0.0, 0.33, RdmA)*180;
#local Theta = Rand_Gauss(0.0, 0.33, RdmB)*180;
#local Offset = Rand_Gauss(0.0, 0.33, RdmC)*3.0;
intersection {
sphere { 0.0, 3.0 }
plane { <sin(Phi)*cos(Theta), sin(Phi)*sin(Theta), cos(Phi)>, Offset }
pigment { White }
translate <-15*6 + I*6, 0, 0>
}
#end
and in a test scene:
#include "kolors.inc"
#include "rand.inc"
light_source {
0*x
color rgb 1
translate <15, 30, -60>
}
camera {
perspective
location <3, 5, -60>
up y
right x*(image_width/image_height)
look_at 0
}
#for(I, 0, 30, 1)
#local Phi = Rand_Gauss(0.0, 0.33, RdmA)*180;
#local Theta = Rand_Gauss(0.0, 0.33, RdmB)*180;
#local Offset = Rand_Gauss(0.0, 0.33, RdmC)*3.0;
intersection {
sphere { 0.0, 3.0 }
plane { <sin(Phi)*cos(Theta), sin(Phi)*sin(Theta), cos(Phi)>, Offset }
pigment { White }
translate <-15*6 + I*6, 0, 0>
}
#end
Now, obviously, the CSG method isn't going to work because of memory
constraints. but you can easily use this method to generate your plane, and then
take the dot-product like so:
#declare Normal = <sin(Phi)*cos(Theta), sin(Phi)*sin(Theta), cos(Phi)>
#declare Mag = Rand_Gauss(0.0, 0.33, RdmC)*BaseRad;
vdot(Mag*Normal, CurrVertex - Mag*Normal)
At least, I think that should work...
Then scale the vertex coordinates based on whether the dot product is positive
or negative.
Regards,
A.D.B.
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) |
Ger <ger### [at] No Spam thank you> wrote:
> On 08/19/2013 10:51 AM, Warp wrote:
> > Ger <ger### [at] no spam thank you> wrote:
> >>>> #declare PlaneAngleX = rand(RandAngle) * 360;
> >>>> #declare PlaneAngleY = rand(RandAngle) * 360;
> >>>> #declare PlaneAngleZ = rand(RandAngle) * 360;
> >>>
> >>> On a separate note, are you sure that method of choosing the plane
> >>> orientation gives a uniform random distribution...?
> >
> >> No, it does not, but doing it this way gives a better result than using
> >> a single rand() for the plane orientation.
> >
> > Better in what way?
> >
> More uniform, but in all honesty, that was not the first thing I was
> paying attention to. I'll run a single vs triple rand() test case later.
>
> --
> Cheers
> Ger
I think I may have spotted the reason why your planet is so turbulent.
You seem to be generating a new displacement for each point in the sphere
individually rather than displacing all the points on one side of the plane by
the same amount.
you should have your displacement macro generate two scaling factors before
iterating through the points: One factor for the positive side of the plane, and
one for the negative side.
Regards,
A.D.B.
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) |
A slight correction:
#local Phi = Rand_Gauss(0.0, 0.33, RdmA)*pi;
#local Theta = Rand_Gauss(0.0, 0.33, RdmB)*pi;
Times like this, I really wish we could edit posts...
Regards,
A.D.B.
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) |