POV-Ray : Newsgroups : povray.newusers : difficulties rendering hexagonal crystal group Server Time
31 Oct 2024 08:14:42 EDT (-0400)
  difficulties rendering hexagonal crystal group (Message 1 to 4 of 4)  
From: engelbert buxbaum
Subject: difficulties rendering hexagonal crystal group
Date: 16 Mar 2009 09:35:00
Message: <web.49be542b519610b7604827740@news.povray.org>
Hi,

in an attempt to explain crystal groups I generated the following:

camera {
  location  <0, 0, -270>
  look_at   <0, 0, 0>
  angle 1.7
}

global_settings {
  assumed_gamma 2.2
  max_trace_level 100
}

light_source { < 10, 10, -10> color rgb <1.0, 1.0, 0.8> }       // right, top,
front
light_source { <-10, 10, -10> color rgb <1.0, 0.8, 1.0> }       // left, top,
front
light_source { < 10,-10, -10> color rgb <0.8, 1.0, 1.0> }       // right, below,
front
light_source { <-10,-10, -10> color rgb <1.0, 1.0, 1.0> }       // left, below,
front
light_source { <0, 0, -10> color rgb <1.0, 1.0, 0.8> area_light
<10,0,0>,<0,10,0>, 5, 5 }   // center, front




//-------------------------- drawing 3 axes --------------------------------

#macro Axis_( AxisLen, RedTexture,WhiteTexture)
union{
    cylinder {<0,-AxisLen,0>,<0,AxisLen,0>,0.05
              texture{checker texture{RedTexture}
                              texture{WhiteTexture}
                      translate<0.1,0,0.1>}}
    cone{<0,AxisLen,0>,0.2,<0,AxisLen+0.7,0>,0
         texture{RedTexture}}
     }
#end

#macro AxisXYZ( AxisLenX, AxisLenY, AxisLenZ, TexRed, TexWhite)

union{
   object{Axis_(AxisLenX, TexRed, TexWhite)   rotate< 0,0,-90>}   // x axis
   object{Axis_(AxisLenY, TexRed, TexWhite)   rotate< 0,0, 30>}   // y axis
   object{Axis_(AxisLenZ, TexRed, TexWhite)   rotate<-90,0,  0>}   // z axis

   text{ ttf"arial.ttf",  "x",  0.15,  0  texture{TexRed}
         scale 0.5 translate <AxisLenX+0.05,0.4,-0.10>}
   text{ ttf"arial.ttf",  "y",  0.15,  0  texture{TexRed}
         scale 0.5 translate <-2,AxisLenY-1.0,-0.00>}
   text{ ttf"arial.ttf",  "z",  0.15,  0  texture{TexRed}
         scale 0.5 translate <-0.4,0,AxisLenZ-6>}
}
#end

// ----------------------- object ----------------------------------


#declare  Hexagon =
 intersection
  {plane {z, 1}  /* Rotate 90 in z axis to stand up */
   plane {z, 1 rotate < 60, 0, 0>}
   plane {z, 1 rotate <120, 0, 0>}
   plane {z, 1 rotate <180, 0, 0>}
   plane {z, 1 rotate <240, 0, 0>}
   plane {z, 1 rotate <300, 0, 0>}
   plane { x, 1}
   plane {-x, 1}

   bounded_by {sphere{0, 1.5}}
  }


#declare Hexagonal =
      intersection{
         object{ Hexagon
               }
         object{ Hexagon
                   translate <0, 0.58, 1>
               }
         texture
            { pigment {color rgbf <0.1, 0.15, 0.5, 1.0> }         // blue
              finish { ambient 0.5 diffuse 0.1 phong 0.2 }
             }
         interior
             { refraction on
               ior 1.0
               fade_distance 10
               fade_power 0.2
             }
      }

#declare CutOut =
     difference{
         object{ Hexagon
               }
         object{ Hexagon
                   scale 1.001
                   translate <0, 0.58, 1>
                                       }
         texture
               { pigment {color rgbf <0.2, 0.2, 0.2, 1.0> }         // grey
                 finish { ambient 0.5 diffuse 0.1 phong 0.05 }
               }
         interior
             { refraction on
               ior 1.0
               fade_distance 10
               fade_power 0.2
             }
     }

#declare Final_Object =
    union{
       object{ Hexagonal }
       object{ CutOut }
       rotate <0, 90, 30>
       translate <0, 0, 1>
       scale <1.7, 1.7, -1.0>
    }


union{
   object{AxisXYZ (3,3,3,
                texture{ pigment{rgb<1,0,0>} finish{diffuse 0.8 phong 1}},
                texture{ pigment{rgb<1,1,1>} finish{diffuse 0.8 phong 1}})
         }
   object{ Final_Object
         }
   rotate<20,-20,0>
}

Both the hexagonal crystal and the cut-out hexagon render fine by themselfs, but
in combination the crystal looses colour, also, the surface of the crystal in
contact with the cut-out becomes invisible. I have fiddled with lighting and
optical properties of the bodies for days, but I just don't get it. Any ideas?

Thanks in advance

Engelbert


Post a reply to this message

From: Bob
Subject: Re: difficulties rendering hexagonal crystal group
Date: 16 Mar 2009 19:19:53
Message: <49bede99$1@news.povray.org>
"engelbert_buxbaum" <eng### [at] hotmailcom> wrote in message 
news:web.49be542b519610b7604827740@news.povray.org...
> Both the hexagonal crystal and the cut-out hexagon render fine by 
> themselfs, but
> in combination the crystal looses colour, also, the surface of the crystal 
> in
> contact with the cut-out becomes invisible. I have fiddled with lighting 
> and
> optical properties of the bodies for days, but I just don't get it. Any 
> ideas?

You might want to use clipped_by {} instead of difference{}, that way the 
faces of the cutout part won't show at all.
And, if you can use it, changing background to white or something other than 
black seems to make this show better, likewise no_shadow could help not 
confuse the shape.
I tried the following with changed filter colors to transmit colors:

#declare Hexagonal =
      intersection{
         object{ Hexagon
               }
         object{ Hexagon
                   translate <0, 0.58, 1>
               }
         texture
            { pigment {color rgbt <0.1, 0.15, 0.5, 0.7> }         // blue
              finish { ambient 0.5 diffuse 0.1 phong 0.2 }
             }
         interior
             { refraction on
               ior 1.0
               fade_color <0.1, 0.15, 0.5>
               fade_distance 2//10
               fade_power 2//0.2
             }
      }

#declare CutOut =
     //difference{
         object{ Hexagon
              // }
              clipped_by{
         object{ Hexagon inverse
                   scale 1.001
                   translate <0, 0.58, 1>
                                       }
                                       }
         texture
               { pigment {color rgbt <0.2, 0.2, 0.2, 0.7> }         // grey
                 finish { ambient 0.5 diffuse 0.1 phong 0.05 }
               }
         interior
             { refraction on
               ior 1.0
               fade_color <0.2, 0.2, 0.2>
               fade_distance 2//10
               fade_power 2//0.2
             }
     }

background {<1,1,1>}

You hadn't given the fade_* a color so I used the ones from pigments, also 
making the distance less and power more.
This shows the crystal parts, with color fading, like I think you're trying 
to do. Main thing is probably that clipped_by being added (with inverse on 
object).

Hopefully that's some help to you. Oh, and not sure from the quick look at 
it but I when I moved one of the parts once while checking on it the 
position didn't seem to relate to the axis arrows. Maybe just my 
perception...

Bob H.


Post a reply to this message

From: engelbert buxbaum
Subject: Re: difficulties rendering hexagonal crystal group
Date: 18 Mar 2009 09:45:00
Message: <web.49c0f9a78bf9de2d604827740@news.povray.org>
"Bob" <omniverse*charter!net> wrote:
> "engelbert_buxbaum" <eng### [at] hotmailcom> wrote in message
> news:web.49be542b519610b7604827740@news.povray.org...
> > Both the hexagonal crystal and the cut-out hexagon render fine by
> > themselfs, but
> > in combination the crystal looses colour, also, the surface of the crystal
> > in
> > contact with the cut-out becomes invisible. I have fiddled with lighting
> > and
> > optical properties of the bodies for days, but I just don't get it. Any
> > ideas?
>
> You might want to use clipped_by {} instead of difference{}, that way the
> faces of the cutout part won't show at all.
> And, if you can use it, changing background to white or something other than
> black seems to make this show better, likewise no_shadow could help not
> confuse the shape.

Yes, clipping does the trick. A little more phong to the cut-out and the
background reduced to rgb 0.3 and this looks quite decent.

Thanks for the hints

Engelbert


Post a reply to this message

From: Alain
Subject: Re: difficulties rendering hexagonal crystal group
Date: 19 Mar 2009 18:01:31
Message: <49c2c0bb$1@news.povray.org>
I spotted some small errors.

engelbert_buxbaum nous illumina en ce 2009-03-16 09:29 -->
> Hi,
> 
> in an attempt to explain crystal groups I generated the following:
> 
> camera {
>   location  <0, 0, -270>
>   look_at   <0, 0, 0>
>   angle 1.7
> }
You could use an orthographic camera.
camera{orthographic
	location -100*z
	look_at 0
}
> 
> global_settings {
>   assumed_gamma 2.2
Phased out. Beter to leave out for future compatibility.

>   max_trace_level 100
> }
> 
> light_source { < 10, 10, -10> color rgb <1.0, 1.0, 0.8> }       // right, top,
> front
> light_source { <-10, 10, -10> color rgb <1.0, 0.8, 1.0> }       // left, top,
> front
> light_source { < 10,-10, -10> color rgb <0.8, 1.0, 1.0> }       // right, below,
> front
> light_source { <-10,-10, -10> color rgb <1.0, 1.0, 1.0> }       // left, below,
> front
> light_source { <0, 0, -10> color rgb <1.0, 1.0, 0.8> area_light
> <10,0,0>,<0,10,0>, 5, 5 }   // center, front
Don't realy need that one.
Making adaptive 0 will greatly increase the rendering speed.
> 
> 
> 
> 
> //-------------------------- drawing 3 axes --------------------------------
> 
> #macro Axis_( AxisLen, RedTexture,WhiteTexture)
> union{
>     cylinder {<0,-AxisLen,0>,<0,AxisLen,0>,0.05
>               texture{checker texture{RedTexture}
>                               texture{WhiteTexture}
>                       translate<0.1,0,0.1>}}
>     cone{<0,AxisLen,0>,0.2,<0,AxisLen+0.7,0>,0
>          texture{RedTexture}}
>      }
> #end
> 
Most of the time, you want 3 axis of the same length. Maybe you only need to 
provide one length.
> #macro AxisXYZ( AxisLenX, AxisLenY, AxisLenZ, TexRed, TexWhite)
> 
> union{
>    object{Axis_(AxisLenX, TexRed, TexWhite)   rotate< 0,0,-90>}   // x axis
>    object{Axis_(AxisLenY, TexRed, TexWhite)   rotate< 0,0, 30>}   // y axis
>    object{Axis_(AxisLenZ, TexRed, TexWhite)   rotate<-90,0,  0>}   // z axis
> 
>    text{ ttf"arial.ttf",  "x",  0.15,  0  texture{TexRed}
>          scale 0.5 translate <AxisLenX+0.05,0.4,-0.10>}
>    text{ ttf"arial.ttf",  "y",  0.15,  0  texture{TexRed}
>          scale 0.5 translate <-2,AxisLenY-1.0,-0.00>}
>    text{ ttf"arial.ttf",  "z",  0.15,  0  texture{TexRed}
>          scale 0.5 translate <-0.4,0,AxisLenZ-6>}
> }
> #end
> 
> // ----------------------- object ----------------------------------
> 
> 
> #declare  Hexagon =
>  intersection
>   {plane {z, 1}  /* Rotate 90 in z axis to stand up */
>    plane {z, 1 rotate < 60, 0, 0>}
>    plane {z, 1 rotate <120, 0, 0>}
>    plane {z, 1 rotate <180, 0, 0>}
>    plane {z, 1 rotate <240, 0, 0>}
>    plane {z, 1 rotate <300, 0, 0>}
>    plane { x, 1}
>    plane {-x, 1}
> 
>    bounded_by {sphere{0, 1.5}}
>   }
A box would provide a tighter bounding shape.
bounded_by{box{<1,1.5,1.5><-1,1.5,1.5>}}
Also, the use of a prism object may be more adventageous.

> 
> 
> #declare Hexagonal =
>       intersection{
>          object{ Hexagon
>                }
>          object{ Hexagon
>                    translate <0, 0.58, 1>
>                }
>          texture
>             { pigment {color rgbf <0.1, 0.15, 0.5, 1.0> }         // blue
>               finish { ambient 0.5 diffuse 0.1 phong 0.2 }
That ambient value is very high. It gives a washed out aspect and make you loose 
much 3D feeling.

>              }
>          interior
>              { refraction on
This is uterly useless, as it's turned off by the next statement.
>                ior 1.0
Any value other than 1 will cause the refraction to be active. A value of 1, as 
here, effectively turn refraction OFF.

>                fade_distance 10
>                fade_power 0.2
Without a fade_color, this is pointless.
Also, fade_power of 0.2 is a fade acording to distance power 1/5 (or the fifth 
root of the distance) whitch is totaly unrealistic. A value of 1 is physicaly 
correct. A value of 1001 is also correct and turn on the "exponential" fading.
>              }
>       }
The ONLY place where refraction on IS relevant, is in a protons{} block of an 
object.
> 
> #declare CutOut =
>      difference{
>          object{ Hexagon
>                }
>          object{ Hexagon
>                    scale 1.001
>                    translate <0, 0.58, 1>
>                                        }
>          texture
>                { pigment {color rgbf <0.2, 0.2, 0.2, 1.0> }         // grey
>                  finish { ambient 0.5 diffuse 0.1 phong 0.05 }
>                }
>          interior
>              { refraction on
>                ior 1.0
>                fade_distance 10
>                fade_power 0.2
>              }
>      }
> 
> #declare Final_Object =
>     union{
>        object{ Hexagonal }
>        object{ CutOut }
>        rotate <0, 90, 30>
>        translate <0, 0, 1>
>        scale <1.7, 1.7, -1.0>
>     }
You have coincident surfaces where the two elements meet. You should move one or 
the other a small bit.
> 
> 
> union{
>    object{AxisXYZ (3,3,3,
>                 texture{ pigment{rgb<1,0,0>} finish{diffuse 0.8 phong 1}},
>                 texture{ pigment{rgb<1,1,1>} finish{diffuse 0.8 phong 1}})
>          }
>    object{ Final_Object
>          }
>    rotate<20,-20,0>
> }
> 
> Both the hexagonal crystal and the cut-out hexagon render fine by themselfs, but
> in combination the crystal looses colour, also, the surface of the crystal in
> contact with the cut-out becomes invisible. I have fiddled with lighting and
> optical properties of the bodies for days, but I just don't get it. Any ideas?
> 
> Thanks in advance
> 
> Engelbert
> 
> 
> 
> 


-- 
Alain
-------------------------------------------------
The worst way to miss someone is to be sitting right beside them knowing you 
can' t have them.


Post a reply to this message

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