POV-Ray : Newsgroups : povray.general : POV-Lab: plans and discussions Server Time
4 May 2024 02:37:59 EDT (-0400)
  POV-Lab: plans and discussions (Message 21 to 30 of 44)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Thomas de Groot
Subject: Re: POV-Lab: plans and discussions
Date: 12 Feb 2023 07:54:21
Message: <63e8e17d@news.povray.org>
Op 12-2-2023 om 13:37 schreef Thomas de Groot:
Better:

sphere {
     <0,0,0>, 1
     pigment {
        gradient y
        color_map {spring}
     scale 2
     translate -1*y
     }
     scale 10
}

-- 
Thomas


Post a reply to this message

From: yesbird
Subject: Re: POV-Lab: plans and discussions
Date: 12 Feb 2023 08:20:00
Message: <web.63e8e74d1a311230bcf31c7f10800fb2@news.povray.org>
Thank you, but I was expected to see all specter, not only one color (see
attachment).
Scene is following:
----------------------------------------------------
#include "jet.inc"
#include "hot.inc"
#include "winter.inc"
#include "parula.inc"
#include "turbo.inc"
#include "bone.inc"
#include "spring.inc"

global_settings { assumed_gamma 1 }

camera { perspective         angle 50
         location <8.50, 3.40, -8.50> * 5
         right x * image_width / image_height
         look_at <0.00, 0, -0.00>
         right  <-1.33, 0.00, 0.000> rotate<90,0,0>}

light_source{<50.0, 50.0, 30.0>rgb <0.80, 0.80, 0.80>}

sphere {
     <0,0,0>, 1
     pigment {
        gradient y
        color_map {spring}
     scale 2
     translate -1*y
     }
     scale 10
}
----------------------------------------------------


Post a reply to this message


Attachments:
Download 'colormaps.png' (52 KB)

Preview of image 'colormaps.png'
colormaps.png


 

From: Thomas de Groot
Subject: Re: POV-Lab: plans and discussions
Date: 12 Feb 2023 08:21:34
Message: <63e8e7de$1@news.povray.org>
However, looking closer, I guess that the color_map indexes are cut-off 
beyond 1.00!!!  :-/

There is a need to transpose/recalculate all indexes to values between 
0.00 and 1.00

-- 
Thomas


Post a reply to this message

From: yesbird
Subject: Re: POV-Lab: plans and discussions
Date: 12 Feb 2023 08:45:00
Message: <web.63e8ed4a1a31123038010da810800fb2@news.povray.org>
> There is a need to transpose/recalculate all indexes to values between
> 0.00 and 1.00

I've tried it already - not helps :(


Post a reply to this message

From: Bald Eagle
Subject: Re: POV-Lab: plans and discussions
Date: 12 Feb 2023 08:50:00
Message: <web.63e8ede11a3112301f9dae3025979125@news.povray.org>
"yesbird" <nomail@nomail> wrote:
> Hi, jr
>
> I've attached the most tasty maps to this message, btw, don't you know how to
> scale them properly, I mean map to object whole specter completely ?
>
> Reading manual:
> https://www.povray.org/documentation/view/3.6.1/335/
> and a lot of experiments with scaling gives no result.
> --
> YB

Your color map for spring goes from 0 to 5.5

Your sphere has a radius of 10.

Normally (<--- get it?) we try to use values from 0 to 1 for everything and then
scale afterwards.

Since you're using a gradient pigment, and the sphere has a diameter of 20, then
you need to make that 5.5 fit across 20 evenly.

The only problem there, is that IIRC, POV-Ray just ignores all of those values
above 1 in the color map definition, and I don't think there's currently a
mechanism that can fix that (like scaling it).

So I plopped the color map into a spreadsheet, divided all of the indices by the
max, and pasted it back out into spring2.inc, then scaled it by 20.

Then the only other thing you have to take into consideration is the fact that
the sphere is at the origin, which means its left side extends over to x=-10.
So before scaling the unit color map, I translate it -x*0.5, and THEN scale it
by 20, so that it goes from -10 to 10.

I hope that helps illustrate how all of this works and how one should think
about it.


Post a reply to this message


Attachments:
Download 'colormaps.png' (80 KB)

Preview of image 'colormaps.png'
colormaps.png


 

From: Bald Eagle
Subject: Re: POV-Lab: plans and discussions
Date: 12 Feb 2023 08:50:00
Message: <web.63e8ee1d1a3112301f9dae3025979125@news.povray.org>
#version 3.8;

#include "jet.inc"
#include "hot.inc"
#include "winter.inc"
#include "parula.inc"
#include "turbo.inc"
#include "bone.inc"
#include "spring2.inc"


global_settings { assumed_gamma 1 }

camera {
 location -z*30
 right x * image_width / image_height
 up y
 sky y
 look_at <0.00, 0, 0.00>
}

light_source{<0.0, 0.0, - 30.0> rgb <0.80, 0.80, 0.80>}

sphere {
 <0,0,0>, 10
 texture {
  pigment {
             gradient x
             color_map {spring}
             translate -x*0.5
             scale 20
  }
  finish {
   diffuse 1
  }
 }
}


Post a reply to this message


Attachments:
Download 'spring2.inc.txt' (11 KB)

From: jr
Subject: Re: POV-Lab: plans and discussions
Date: 12 Feb 2023 09:10:00
Message: <web.63e8f28c1a31123088a828ca6cde94f1@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
> "yesbird" <nomail@nomail> wrote:
> > ...
> > I've attached the most tasty maps to this message, btw, don't you know how to
> > scale them properly, I mean map to object whole specter completely ?

cheers, got the zip, reading the posts, they may have to be re-created to use
the 0.0-1.0 range.


> So I plopped the color map into a spreadsheet, ...

I used a simple two colour map, at frequency 8, scale 1.5 (from unit sphere. :-)


regards, jr.


Post a reply to this message


Attachments:
Download 'yb.png' (76 KB)

Preview of image 'yb.png'
yb.png


 

From: yesbird
Subject: Re: POV-Lab: plans and discussions
Date: 12 Feb 2023 09:15:00
Message: <web.63e8f33c1a31123038010da810800fb2@news.povray.org>
Hi,

> I hope that helps illustrate how all of this works and how one should think
> about it.

Thanks a lot for very professional and detailed explanation, now I will sleep
well at night :)
--
YB


Post a reply to this message

From: yesbird
Subject: Re: POV-Lab: plans and discussions
Date: 12 Feb 2023 09:20:00
Message: <web.63e8f4a61a31123038010da810800fb2@news.povray.org>
> I used a simple two colour map, at frequency 8, scale 1.5 (from unit sphere. :-)

Beautiful planet !
--
YB


Post a reply to this message

From: Bald Eagle
Subject: Re: POV-Lab: plans and discussions
Date: 12 Feb 2023 09:40:00
Message: <web.63e8f9761a3112301f9dae3025979125@news.povray.org>
"yesbird" <nomail@nomail> wrote:

> Thanks a lot for very professional and detailed explanation, now I will sleep
> well at night :)

It's always the simple things that will truly drive you crazy.

Especially when there are no in-scene commands to fix them.

A few observations:

You have a "right" directive twice in your camera block.
You may want to read about the camera and the way it works since there are some
commands that will alter previous camera commands, so there is --- I'll call it
a preferred order of operations.  clipka and Le Forgeron have discussed this in
a few NewsGroup posts.

http://news.povray.org/53ff509f%241%40news.povray.org

Also, in case you need it:

http://news.povray.org/povray.binaries.images/thread/%3C5d95e6c3%241%40news.povray.org%3E/

I'd also try to establish some sort of standard indentation for things like
loops and textures and such - it will save a lot of time in debugging things
when you leave out a closing ) or }.   The POV-Ray parser will try to lump
everything after the missing symbol into the opening declaration, and the error
messages might be sending you on a wild goose chase.

I also tend to label my closing brackets so I know which #while #for #case #if
#macro I'm ending, or where in the tangle of texture, pigment, color_map,
pigment_map, finish, normal, function, texture_map, etc I'm at.

texture {
     pigment {
          color_map {
          } // end color_map
     } // end pigment
} // end texture

I'll even number them if I have a ton of nested flow control directives, so I
can keep them all straight.


With regard to the color_map, I'll say that this is just another example of
making the hard-coded data in your scene difficult to nearly impossible to
manipulate.   You might consider storing all of that data in an array, and then
building the color map from that.   Then you can mathematically manipulate the
index values any way you want.   It's also very useful in case you want to embed
"lines" into a map - in order to make grids, or bracket a region of something,
or fix an uneven-looking map that doesn't get interpolated the way that you want
visually.

That's also a LOT of color_map entries.   You might consider experimenting with
the interpolation between the first entry and the last, just assigning them 0
and 1 and see what happens.   There are also new blending modes in 3.8.

Lots of stuff.   Too much to take in all at once.  :)

- BW


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

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