POV-Ray : Newsgroups : povray.advanced-users : Comparing colors specified by byte-value using POV-Ray rgb : Comparing colors specified by byte-value using POV-Ray rgb Server Time
15 Jun 2024 09:57:16 EDT (-0400)
  Comparing colors specified by byte-value using POV-Ray rgb  
From: Bald Eagle
Date: 28 Apr 2024 09:20:00
Message: <web.662e4bfa5c0f47661f9dae3025979125@news.povray.org>
Continuing with the A* pathfinding project,

(AND perhaps the srgb - rgb thread)

I have an image that I generate by color-filling M$ Excel cells, and
copy-pasting that into IrfanView, and saving to .png

I then want to look at certain colors to determine if it's a walkable path, or
an obstacle.

This works well when I specify colors with all 255's or all 0's, but when I have
intermediate shades, I'm trying to use the <0-255, 0-255, 0-255>/255 value as a
comparison, but the algorithm is just recognizing it all as unwalkable.

I'll probably have to go back on run some tests to see what eval_pigment returns
as an rgb triplet.
I'm wondering if I'm going to have to have to use srgb.
I also was thinking about specifying a narrow _range_ of values to give me a
+/-1 wiggle room in byte values when converted to 0-1, so that'll probably
involve math.inc and a special use of VEq and a threshold.

Has anyone ever come across a situation like this?





I currently have enough worked out where I can randomly place 100 people in the
building and sequentially solve the "maze" to generate a shortest exit-path for
all 100 people.  I'm skipping over 5 pixels of the map at every step to generate
a much smaller "graph" to search, but it still takes about 5 min.

- BE


Post a reply to this message

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