POV-Ray : Newsgroups : povray.general : problem with poly object : Re: problem with poly object Server Time
4 Nov 2024 21:25:25 EST (-0500)
  Re: problem with poly object  
From: superbus
Date: 7 Sep 2003 15:45:01
Message: <web.3f5b8a525f08704355a148e60@news.povray.org>
>> I doubt that is the case. See -
>> http://news.povray.org/povray.bugreports/7728/?tmax=100
>>
yes this looks very similar to my problem, I think.

>Yes, but as no scene was shown, I assume the "easy" causes.

Here goes simple example. Uncoment to get "poly" or "isosurface" version.
In case of poly objects, farer objects get disturbed with black lines.

// start of source file
#include "colors.inc"
camera {
   location  <0, 1, -3>
   look_at   <0, 1, 0>
}
light_source { <-15, 30, -25> color red 1 green 1 blue 1 }
light_source { < 15, 30, -25> color red 1 green 1 blue 1 }

#declare rot = transform{ translate <-1,0,0> /*rotate x*30 rotate y*30
rotate -z*30*/ scale 2}

//************************************************************
//*Polynomial as poly
//************************************************************
#macro polypoly(tr)
poly {
9,
<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0.0555556,0.0833333,0.0277778,-0.0277778,0,0.0833333,-0.0833333,-0.0833333,-0.0277778,0,0,-0.0833333,0.0833333,0.0833333,0.0277778,0,0,0,0.0277778,-0.194444,0.138889,0.268519,0,0,0,0,0,0,0,0,0,0,0,
0.0833333,-0.0833333,-0.0833333,-0.0277778,0,0,-0.25,0.25,0.25,0.0833333,0,0,0,0.25,-0.25,-0.25,-0.0833333,0,0,0,0,0.416667,-0.416667,-0.416667,-0.138889,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0.0833333,0.0833333,0.0833333,0.0277778,0,0,0,0.25,-0.25,-0.25,-0.0833333,0,0,0,0,-0.25,0.25,0.25,0.0833333,0,0,0,0,0,-0.416667,0.416667,0.416667,0.138889,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0.0277778,-0.0277778,-0.0277778,-0.00925926,0,0,0,0,-0.0833333,0.0833333,0.0833333,0.0277778,0,0,0,0,0,0.0833333,-0.0833333,-0.0833333,-0.0277778,0,0,0,0,0,0,-0.527778,0.861111,0.861111,-0.712963
>
sturm
bounded_by{box{<0,0,0><1,1,1>}}
clipped_by{bounded_by}

  pigment { checker Blue, White
         scale 0.2
          }
  finish {
        ambient 0.2
        diffuse 0.8
        phong 0.7
    }
    transform{
        translate tr
        transform rot
    }
}
#end

//************************************************************
//*Polynomial as isosurface
//************************************************************
#macro polyiso(tr)
isosurface {
function {
(-0.0555556*x*x*x*y*y*y*z*z*z)+(0.0833333*x*x*x*y*y*y*z*z)+(0.0277778*x*x*x*y*y*y*z)+(-0.0277778*x*x*x*y*y*y)+(0.0833333*x*x*x*y*y*z*z*z)+(-0.0833333*x*x*x*y*y*z*z)+(-0.0833333*x*x*x*y*y*z)+(-0.0277778*x*x*x*y*y)+(-0.0833333*x*x*x*y*z*z*z)+(0.0833333*x*x*x*y*z*z)+(0.0833333*x*x*x*y*z)+(0.0277778*x*x*x*y)+(0.0277778*x*x*x*z*z*z)+(-0.194444*x*x*x*z*z)+(0.138889*x*x*x*z)+(0.268519*x*x*x)+
(0.0833333*x*x*y*y*y*z*z*z)+(-0.0833333*x*x*y*y*y*z*z)+(-0.0833333*x*x*y*y*y*z)+(-0.0277778*x*x*y*y*y)+(-0.25*x*x*y*y*z*z*z)+(0.25*x*x*y*y*z*z)+(0.25*x*x*y*y*z)+(0.0833333*x*x*y*y)+(0.25*x*x*y*z*z*z)+(-0.25*x*x*y*z*z)+(-0.25*x*x*y*z)+(-0.0833333*x*x*y)+(0.416667*x*x*z*z*z)+(-0.416667*x*x*z*z)+(-0.416667*x*x*z)+(-0.138889*x*x)+
(-0.0833333*x*y*y*y*z*z*z)+(0.0833333*x*y*y*y*z*z)+(0.0833333*x*y*y*y*z)+(0.0277778*x*y*y*y)+(0.25*x*y*y*z*z*z)+(-0.25*x*y*y*z*z)+(-0.25*x*y*y*z)+(-0.0833333*x*y*y)+(-0.25*x*y*z*z*z)+(0.25*x*y*z*z)+(0.25*x*y*z)+(0.0833333*x*y)+(-0.416667*x*z*z*z)+(0.416667*x*z*z)+(0.416667*x*z)+(0.138889*x)+
(0.0277778*y*y*y*z*z*z)+(-0.0277778*y*y*y*z*z)+(-0.0277778*y*y*y*z)+(-0.00925926*y*y*y)+(-0.0833333*y*y*z*z*z)+(0.0833333*y*y*z*z)+(0.0833333*y*y*z)+(0.0277778*y*y)+(0.0833333*y*z*z*z)+(-0.0833333*y*z*z)+(-0.0833333*y*z)+(-0.0277778*y)+(-0.527778*z*z*z)+(0.861111*z*z)+(0.861111*z)+(-0.712963)
}
    max_gradient 4
    open
    bounded_by { box { <0,0,0>, <1,1,1> } }
    clipped_by { bounded_by }

      pigment { checker Blue, White
         scale 0.2
          }
  finish {
        ambient 0.2
        diffuse 0.8
        phong 0.7
    }
    transform{
        translate tr
        transform rot
    }
}
#end

//************************************************************
//********************* HERE CHOOSE **************************
//************************************************************

  polyiso(<-0.2,0,0>)
  polyiso(<1,0,5>)
  polyiso(<4,0,10>)

//  polypoly(<-0.2,0,0>)
//  polypoly(<1,0,5>)
//  polypoly(<4,0,10>)

//************************************************************
//************************************************************
plane {y, -2
 pigment {
  checker Yellow, Green
  scale 2
 }
 finish {
  ambient 0.2
  diffuse 0.8
 }
 hollow
 clipped_by{box{<20,20,20><-20,-20,-20>}}
}
// end of source

For explanation waht it represents:
The polynomials are generated. It represents zero level of tricubic
interpolation of
values in 8 vertexes of unity cube. It shall be something like cubic patch
commonly used in surfaces but here it is in one more dimension.


Post a reply to this message

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