POV-Ray : Newsgroups : povray.newusers : hexagons Server Time
1 Nov 2024 09:19:58 EDT (-0400)
  hexagons (Message 1 to 5 of 5)  
From: Carl
Subject: hexagons
Date: 29 Nov 2005 23:50:00
Message: <web.438d2ecd2b89f37c86f3d1320@news.povray.org>
Hello,

   See image area for picture.  I'm trying to use this image to create a
background of the same color hexagons in POV-Ray.

First problem.  I can use a program like paint to get the colors of each of
the hexagons.  <214,227,240> for example.  I believe I need to divide this
by 256 but even after doing that the hexagon that is drawn isn't the same
color as the one in the image I posted.  Why?  How can I control the color
I get in the rendered image?

I've got a little macro like this and I'm not using light sources:

#macro hex(v1,r1,HexColor)
  #local hexa = prism {linear_sweep linear_spline -1, 1, 7,
   <r1,0>, <r1*cos(radians(60)),r1*sin(radians(60))>,
   <-r1*cos(radians (60)),r1*sin(radians(60))>,
   <-r1,0>, <-r1*cos(radians(60)),-r1*sin(radians(60))>,
   <r1*cos(radians(60)),-r1*sin(radians(60))>, <r1,0>};
    object {hexa
      pigment {rgb HexColor/256}
      finish {ambient 1}
      rotate x*90
      translate v1
    }
#end

Second question... in the past I've seen some really nice images of glowing
boxes posted.  I assumed this was pulled off with radiosity.  I was wanting
to try and make these hexagons glow in a similiar fasion however nothing I
try even comes close to the effects I've seen here before.  I've searched
for the image of the boxes I remember and I can't seem to locate it now.
Could someone point me in the right direction?  This project I hope to turn
into a Christmas gift for someone so any help is greatly appreciated.

Thanks,
Carl


Post a reply to this message

From: Slime
Subject: Re: hexagons
Date: 30 Nov 2005 01:30:14
Message: <438d46f6@news.povray.org>
> First problem.  I can use a program like paint to get the colors of each
of
> the hexagons.  <214,227,240> for example.  I believe I need to divide this
> by 256 but even after doing that the hexagon that is drawn isn't the same
> color as the one in the image I posted.

Divide by 255 (since this is the maximum possible value). Also set diffuse
to 0 if you have light sources. If there's still a difference (if POV-Ray's
output is lighter than the specified color), it may be due to gamma
correction.

> Second question... in the past I've seen some really nice images of
glowing
> boxes posted.  I assumed this was pulled off with radiosity.

Probably. All you need is for the object you want to glow to have a high
ambient value (you already have this), and for other objects to be around
it. Then add radiosity{} to your global_settings{} block, and the other
objects will be lit up by the one with high ambient. The hard part is
tweaking the radiosity settings to make it look good. =)

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Carl
Subject: Re: hexagons
Date: 30 Nov 2005 14:20:01
Message: <web.438df9c3399d84c170dc520d0@news.povray.org>
"Slime" <fak### [at] emailaddress> wrote:
> Divide by 255 (since this is the maximum possible value). Also set diffuse
> to 0 if you have light sources. If there's still a difference (if POV-Ray's
> output is lighter than the specified color), it may be due to gamma
> correction.

Ok... Here is the code I'm playing with at the moment:

  #include "colors.inc"
  #include "transforms.inc"

  global_settings{assumed_gamma 1}

  camera {location <10,8,-70> look_at <10,8,0> angle 20 right 10/8*x up y}

  plane {y,0 pigment {White} finish {ambient 1}
    rotate -90*x translate 10*z}

  #macro hex(v1,r1,HexColor)
    #local hexa = prism {linear_sweep linear_spline -1, 1, 7,
      <r1,0>, <r1*cos(radians(60)),r1*sin(radians(60))>,
      <-r1*cos(radians(60)),r1*sin(radians(60))>, <-r1,0>,
      <-r1*cos(radians(60)),-r1*sin(radians(60))>,
      <r1*cos(radians(60)),-r1*sin(radians(60))>, <r1,0>};
    object {hexa
      pigment {rgb HexColor/255}
      finish {ambient 1 diffuse 0}
      rotate x*90
      translate v1
    }
  #end

  hex(<10,8,-8>,2,<214,227,240>)

Diffuse is set to 0, there are no light sources, assumed gamma is set to 1,
I'm now dividing by 255 and I'm STILL not getting the color I'm after.  Any
other ideas?

See the latest image I'm posted in the image agea.  The large Hexagon was
rendered in POV-Ray.  I want it the same color as the hexagon closest to
it.  My paint program tells me the one I'm trying to copy is <214,227,240>,
the same value I'm feeding POV-Ray above.  However my paint program tells
me that the color I got was <235,241,248>.  I'm using POV-Ray version 3.6
on a DELL running Windows XP version 2002 if that makes a difference.

I can live without the glow but I'd atleast like to be able to get the color
correct.

Help,
Carl


Post a reply to this message

From: Carl
Subject: Re: hexagons
Date: 30 Nov 2005 17:35:01
Message: <web.438e281c399d84c170dc520d0@news.povray.org>
"Carl" <car### [at] semisouthcom> wrote:
> Any other ideas?

I think I just answered my own question...

I need "Display_Gamma=1" in the command line.

One of these days I'll know all this stuff...

Thanks... now back to playing with radiosity,

Carl


Post a reply to this message

From: Slime
Subject: Re: hexagons
Date: 30 Nov 2005 23:27:18
Message: <438e7ba6$1@news.povray.org>
> I need "Display_Gamma=1" in the command line.

This will make the colors look right, except that you'll remove the effect
of gamma correction (which means the rest of your scene won't be gamma
corrected properly).

A better approach would probably be to choose the colors so that they appear
as you want them to on your monitor *after* gamma correction. To do this,
use this code:

#declare my_display_gamma = 1.8; // or whatever it's set to on your monitor
#declare scene_assumed_gamma = 1;
#declare power = my_display_gamma/scene_assumed_gamma;

#macro ReverseGammaCorrection(Color)
<pow(Color.x, power), pow(Color.y, power), pow(Color.z, power)>
#end

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

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