POV-Ray : Newsgroups : povray.advanced-users : accuracy ? Server Time
1 Nov 2024 15:25:02 EDT (-0400)
  accuracy ? (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Jan Walzer
Subject: accuracy ?
Date: 16 Nov 2001 13:19:21
Message: <3bf558a9$1@news.povray.org>
I'm trying, to play a bit with meshes ...
I build a sphere with a rekursive tesselation ...
so far a OK

Next step was to add some noise to the surface...
I decided to add the value of the bozo ...
but now, the triangles no longer fit together ...

Where did I mix up the wrong variables ?
Image is going to p.b.i.


file://---------------------------------------------------------
#declare Fn_p=function {
    pattern {
        bozo
        scale 0.1
        }
    }

#declare Fn=function {
    (Fn_p(x,y,z)-0.5)*0.05
    }

#macro Recursion(p1,p2,p3,c,d)
    #local pp1=vnormalize(p1-c)+c+Fn(p1.x,p1.y,p1.z)*p1;
    #local pp2=vnormalize(p2-c)+c+Fn(p2.x,p2.y,p2.z)*p2;
    #local pp3=vnormalize(p3-c)+c+Fn(p3.x,p3.y,p3.z)*p2;
    #if (d>0)
        Recursion(pp1,(pp1+pp2)/2,(pp1+pp3)/2,c,d-1)
        Recursion((pp2+pp3)/2,(pp1+pp2)/2,pp2,c,d-1)
        Recursion((pp2+pp3)/2,pp3,(pp1+pp3)/2,c,d-1)
        Recursion((pp2+pp3)/2,(pp1+pp3)/2,(pp1+pp2)/2,c,d-1)

    #else
        triangle {pp1,pp2,pp3}
    #end
#end


#macro RecurseObj(c,d)
    mesh

    Recursion (c+x,c+y,c-z,c,d)
    Recursion (c+x,c-y,c-z,c,d)
    Recursion (c-x,c+y,c-z,c,d)
    Recursion (c-x,c-y,c-z,c,d)
//    Recursion (c+x,c+y,c+z,c,d)
//    Recursion (c+x,c-y,c+z,c,d)
//    Recursion (c-x,c+y,c+z,c,d)
//    Recursion (c-x,c-y,c+z,c,d)
    }
#end



// ----------------------------------------

camera {
  location  <0.0, 0.5, -4.0>
  direction 1.5*z
  right     x*image_width/image_height
  look_at   <0.0, 0.0,  0.0>
}

light_source {
  <0, 0, 0>            // light's position (translated below)
  color rgb <1, 1, 1>  // light's color
  translate <-30, 30, -30>
}

// ----------------------------------------

plane {
  y, -1
  pigment { color rgb <0.7,0.5,0.3> }
}

object {
    RecurseObj(0.1,6)   // recursiondepth ans Center of sphere...
    pigment {color rgbt <1,1,1,0.0>}
    }

--
Jan Walzer <jan### [at] lzernet>


Post a reply to this message

From: JRG
Subject: Re: accuracy ?
Date: 16 Nov 2001 15:24:30
Message: <3bf575fe@news.povray.org>
First of all I'd want to say  that I did not look to your macros (I'm sorry
but hand editing meshes is not my strong point). That said, I think that
this could be some floating point approximation problem. Maybe I'm
completely wrong (in that case forgive me, please) but I think that with a
mesh2 object you could avoid this problem (two coincident vertexes are not
reapeted, are they?).

--
Jonathan.

"Jan Walzer" <jan### [at] lzernet> ha scritto nel messaggio
news:3bf558a9$1@news.povray.org...
> I'm trying, to play a bit with meshes ...
> I build a sphere with a rekursive tesselation ...
> so far a OK
>
> Next step was to add some noise to the surface...
> I decided to add the value of the bozo ...
> but now, the triangles no longer fit together ...
>
> Where did I mix up the wrong variables ?
> Image is going to p.b.i.
>
>
> file://---------------------------------------------------------
> #declare Fn_p=function {
>     pattern {
>         bozo
>         scale 0.1
>         }
>     }
>
> #declare Fn=function {
>     (Fn_p(x,y,z)-0.5)*0.05
>     }
>
> #macro Recursion(p1,p2,p3,c,d)
>     #local pp1=vnormalize(p1-c)+c+Fn(p1.x,p1.y,p1.z)*p1;
>     #local pp2=vnormalize(p2-c)+c+Fn(p2.x,p2.y,p2.z)*p2;
>     #local pp3=vnormalize(p3-c)+c+Fn(p3.x,p3.y,p3.z)*p2;
>     #if (d>0)
>         Recursion(pp1,(pp1+pp2)/2,(pp1+pp3)/2,c,d-1)
>         Recursion((pp2+pp3)/2,(pp1+pp2)/2,pp2,c,d-1)
>         Recursion((pp2+pp3)/2,pp3,(pp1+pp3)/2,c,d-1)
>         Recursion((pp2+pp3)/2,(pp1+pp3)/2,(pp1+pp2)/2,c,d-1)
>
>     #else
>         triangle {pp1,pp2,pp3}
>     #end
> #end
>
>
> #macro RecurseObj(c,d)
>     mesh
>
>     Recursion (c+x,c+y,c-z,c,d)
>     Recursion (c+x,c-y,c-z,c,d)
>     Recursion (c-x,c+y,c-z,c,d)
>     Recursion (c-x,c-y,c-z,c,d)
> //    Recursion (c+x,c+y,c+z,c,d)
> //    Recursion (c+x,c-y,c+z,c,d)
> //    Recursion (c-x,c+y,c+z,c,d)
> //    Recursion (c-x,c-y,c+z,c,d)
>     }
> #end
>
>
>
> // ----------------------------------------
>
> camera {
>   location  <0.0, 0.5, -4.0>
>   direction 1.5*z
>   right     x*image_width/image_height
>   look_at   <0.0, 0.0,  0.0>
> }
>
> light_source {
>   <0, 0, 0>            // light's position (translated below)
>   color rgb <1, 1, 1>  // light's color
>   translate <-30, 30, -30>
> }
>
> // ----------------------------------------
>
> plane {
>   y, -1
>   pigment { color rgb <0.7,0.5,0.3> }
> }
>
> object {
>     RecurseObj(0.1,6)   // recursiondepth ans Center of sphere...
>     pigment {color rgbt <1,1,1,0.0>}
>     }
>
> --
> Jan Walzer <jan### [at] lzernet>
>
>


Post a reply to this message

From: Jan Walzer
Subject: Re: accuracy ?
Date: 16 Nov 2001 15:56:45
Message: <3bf57d8d$1@news.povray.org>
"JRG" <jrg### [at] hotmailcom> schrieb im Newsbeitrag
news:3bf575fe@news.povray.org...
> First of all I'd want to say  that I did not look to your macros (I'm sorry
so why did you repeat the whole thing then ?

> but hand editing meshes is not my strong point). That said, I think that
> this could be some floating point approximation problem. Maybe I'm
> completely wrong (in that case forgive me, please) but I think that with a
> mesh2 object you could avoid this problem (two coincident vertexes are not
> reapeted, are they?).
correct in parts ...
You can in mesh2 use one vertex for multiple triangles ..
but AFAIK you can also to the same mess, and put every vertex multiple
times in the list ...
Also, I just tried this algorithm the first time, and it was easier to
create with a normal mesh...
Maybe I'll try to port it to mesh2, but this will be quite hard ...

on the other hand, it was possible, by only changing some steps in the logic
of the computation, to clear these holes, but the thing is, I don't know, why
they happend here ... I don't believe here in accuracy things ... that would
be
to simple...

--
Jan Walzer <jan### [at] lzernet>


Post a reply to this message

From: Jérôme Grimbert
Subject: Re: accuracy ?
Date: 17 Nov 2001 12:58:33
Message: <3BF6A53A.F86D0573@free.fr>
Jan Walzer wrote:
> 
> I'm trying, to play a bit with meshes ...
> I build a sphere with a rekursive tesselation ...
> so far a OK
> 
> Next step was to add some noise to the surface...
> I decided to add the value of the bozo ...
> but now, the triangles no longer fit together ...
> 
> Where did I mix up the wrong variables ?

Trying to provide some light...

you should experiment with

#declare Fn=function {
        0.2
    }

And see the resulting image.
The problem does not come from the bozo,
nor from precision loss.

I Hope this could help.


Post a reply to this message

From:
Subject: Re: accuracy ?
Date: 19 Nov 2001 03:31:52
Message: <rqghvtg9eigbucr72homvnsi3pns0vcr3j@4ax.com>

> Trying to provide some light...
> you should experiment with
> #declare Fn=function {0.2}
> And see the resulting image.
>The problem does not come from the bozo,
> nor from precision loss.

There were such sentence within this beta-test group:
"It make ***not*** sense to have a function with
_zero_ parameters and thus it is not allowed."
Such example shows it is sometimes useful.

ABX
--
#declare _=function(a,b,x){((a^2)+(b^2))^.5-x}#default {pigment{color rgb 1}}
union{plane{y,-3}plane{-x,-3}finish{reflection 1 ambient 0}}isosurface{ //ABX
function{_(x-2,y,1)|_((x+y)*.7,z,.1)|_((x+y+2)*.7,z,.1)|_(x/2+y*.8+1.5,z,.1)}
contained_by{box{<0,-3,-.1>,<3,0,.1>}}translate z*15finish{ambient 1}}//POV35


Post a reply to this message

From: Warp
Subject: Re: accuracy ?
Date: 19 Nov 2001 04:05:26
Message: <3bf8cb56@news.povray.org>

: There were such sentence within this beta-test group:
: "It make ***not*** sense to have a function with
: _zero_ parameters and thus it is not allowed."
: Such example shows it is sometimes useful.

  What is the fundamental difference between this:

#declare Fn=function {0.2}

and this:

#declare Fn=0.2;

?

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From:
Subject: Re: accuracy ?
Date: 19 Nov 2001 04:09:16
Message: <quihvtci1otu08aapgmt3qj2kics0gknch@4ax.com>
On 19 Nov 2001 04:05:26 -0500, Warp <war### [at] tagpovrayorg> wrote:

>  What is the fundamental difference between this:
> #declare Fn=function {0.2}
> and this:
> #declare Fn=0.2;

is it rhetorical question ?
my answer is "refferencing way" ;-)

ABX


Post a reply to this message

From: Warp
Subject: Re: accuracy ?
Date: 19 Nov 2001 04:39:32
Message: <3bf8d354@news.povray.org>

:>  What is the fundamental difference between this:
:> #declare Fn=function {0.2}
:> and this:
:> #declare Fn=0.2;

: is it rhetorical question ?

  Nope. What I tried to say was that the function declaration above is
more or less obsolete.

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: Jérôme Grimbert
Subject: Re: accuracy ?
Date: 19 Nov 2001 04:51:29
Message: <3BF8D68C.A2D05CDA@atosorigin.com>
Warp wrote:
> 

> :>  What is the fundamental difference between this:
> :> #declare Fn=function {0.2}
> :> and this:
> :> #declare Fn=0.2;
> 
> : is it rhetorical question ?
> 
>   Nope. What I tried to say was that the function declaration above is
> more or less obsolete.

Maybe, but a function declaration without parameter implicitely got three
parameters (x,y,z). Now, nothing force you to use the parameters 
for the computation of the function...

Invoking the function DOES request the parameters, and what was 
previously said was that INVOKING a function without parameters was
a non-sense (to which I agree).

Rather than nitpicking about the function syntax, we should try to solve
the initial query.


Post a reply to this message

From: Jan Walzer
Subject: Re: accuracy ?
Date: 19 Nov 2001 10:27:28
Message: <3bf924e0@news.povray.org>
> Rather than nitpicking about the function syntax, we should try to solve
> the initial query.

it  was a problem in the logic of thinking ...
What I changed was:

    #local pp1=vnormalize(p1-c)+c+Fn(p1.x,p1.y,p1.z)*p1;
    #local pp2=vnormalize(p2-c)+c+Fn(p2.x,p2.y,p2.z)*p2;
    #local pp3=vnormalize(p3-c)+c+Fn(p3.x,p3.y,p3.z)*p2;

to the following:

    #local pp1=vnormalize(p1-c);
    #local pp2=vnormalize(p2-c);
    #local pp3=vnormalize(p3-c);
    #local pp1=pp1+Fn(pp1.x,pp1.y,pp1.z)*pp1+c;
    #local pp2=pp2+Fn(pp2.x,pp2.y,pp2.z)*pp2+c;
    #local pp3=pp3+Fn(pp3.x,pp3.y,pp3.z)*pp3+c;
.
So it was neither the bozo, nor an accuracy-problem ...
What makes me wonder is, WHY this makes a difference ?

Shouldn't the first approach treat the congruent(?) points of the adjacent(?)
triangles all in the same way, so they still should be all in the same point
?
Obviously they are not, but why? Furthermore, Why did the second way solve
this ?(Indeed, it is no longer the identical function to the first way, but
it
fits to my needs)

Now, Okay .. The resulting image is in p.b.i ... I did the spheres as meshes,
to
be able to play a bit with LevelOfDetail Algorithms ...

--
Jan Walzer <jan### [at] lzernet>


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.