POV-Ray : Newsgroups : povray.newusers : difficulties rendering hexagonal crystal group : Re: difficulties rendering hexagonal crystal group Server Time
28 Jul 2024 14:25:37 EDT (-0400)
  Re: difficulties rendering hexagonal crystal group  
From: Alain
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.