POV-Ray : Newsgroups : povray.documentation.inbuilt : 3.7xx: max_extent (re: image resolution) is missing something? Server Time
28 Mar 2024 13:28:31 EDT (-0400)
  3.7xx: max_extent (re: image resolution) is missing something? (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Kenneth
Subject: 3.7xx: max_extent (re: image resolution) is missing something?
Date: 8 Jun 2017 13:30:00
Message: <web.593988c1122841b6883fb31c0@news.povray.org>
(running 3.7.1 beta 8)
In the in-built documentation "3.3.1.6.5 Functions"...

In the section "min_extent/max_extent', concerning the new 3.7xx feature of
reading the pixel resolution of an image, the example given there seems to be
missing something. Part of it is written like this...

......
#declare Resolution = max_extent ( MatteImage );
#declare MatteNormalizationScale =
;

There's nothing following   MatteNormalizationScale   except a semi-colon (which
naturally produces a fatal parse error, when I place an image_map pigment into
the preceeding max_extent). Should it instead be written as...

#declare MatteNormalizationScale = Resolution;

??

(Personally, I don't know, as I haven't tried using the feature yet.)

*However*, the remainder of that example says...

box { 0, <1,1,0.001 pigment { MatteImage }
scale MatteNormalizationScale // Fit matte to unit square
scale MatteSceneScale // Size matte for scene
}

....in which case,    MatteNormalizationScale = Resolution   would not seem to
make sense, as it does not "Fit matte to unit square ". (The matte image is
*already* fit to the unit square, by default.)

Some clarification(s) needed?


Post a reply to this message

From: Bald Eagle
Subject: Re: 3.7xx: max_extent (re: image resolution) is missing something?
Date: 8 Jun 2017 13:50:06
Message: <web.59398df47cb8f4dcc437ac910@news.povray.org>
Well, here's how I've been using it for the past several years:

//  Sized image Map - 1 unit thick box
#declare XSize = 40;
#declare ImageMap = pigment {image_map {jpeg "TestGear.jpg" once} };
#declare Resolution = max_extent (ImageMap) + <0, 0, 1>;


#declare ImageMappedBox =
 box {0, 1
  texture {
   pigment {ImageMap}
  }
  translate <-0.5, -0.5, -0.5>
  scale Resolution*(1/Resolution.x)*XSize
  //translate y*(Resolution.y / Resolution.x)*XSize/2
 }


Note that there are only  x and y non-zero-values to the max_extent, so that's
what the addition of the vector in defining Resolution is for (to avoid warnings
when using scale.

That last translation is to move the box from origin-centered to having it's
base at y=0.


Post a reply to this message

From: Kenneth
Subject: Re: 3.7xx: max_extent (re: image resolution) is missing something?
Date: 8 Jun 2017 14:15:05
Message: <web.593992ed7cb8f4dc883fb31c0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

>
> Note that there are only  x and y non-zero-values to the max_extent, so that's
> what the addition of the vector in defining Resolution is for (to avoid warnings
> when using scale.
>

Yep, *that* by itself makes sense; good idea. The docs still need some
overhauling.


Post a reply to this message

From: Bald Eagle
Subject: Re: 3.7xx: max_extent (re: image resolution) is missing something?
Date: 8 Jun 2017 15:25:01
Message: <web.5939a3997cb8f4dcc437ac910@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:

> Yep, *that* by itself makes sense; good idea. The docs still need some
> overhauling.

Yes, and I understand, from experience, how difficult a job it is to document
something, well, and keep it updated.

I think that having a few lines of working SDL to demonstrate how something
works is worth pages of documentation and dozens of (often redundant) forum
question and answer threads.

I really liked the following excerpt from Graphics Gems 3:

https://doc.lagout.org/Others/Game%20Development/Programming/Graphics%20Gems%203.pdf

Since the first volume of Graphics Gems was published, I have spoken to many
readers
and discovered that these books have helped people learn graphics by starting
with

with the codes
so freely, but I think I now see why this helps. It is often exciting to start
learning a new
medium by simply messing around in it, and understanding how it flows. My piano
teacher
encourages new students to begin by spending time playing freely at the
keyboard: keep a
few scales or chord progressions in mind, but otherwise explore the spaces of
melody,
harmony, and rhythm. When I started to learn new mediums in art classes, I often
spent
time simply playing with the medium: squishing clay into odd shapes or brushing
paint on
paper in free and unplanned motions. Of course one often moves on to develop
control

springs
from such uncontrolled and spirited play.
It is difficult for the novice to play at programming. There is little room for
simple
expression or error. A simple program does not communicate with the same range
and
strength as a masterfully simple line drawing or haunting melody. A programmer
cannot
hit a few wrong notes, or tolerate an undesired ripple in a line. If the syntax


anything
interesting. There are exceptions to the latter statement, but they are notable
because of

got to do some
things completely right, and everything else almost perfectly. That can be an
intimidating
realization particularly for the beginner: if a newly constructed program

problem could be in a million places, anywhere from the architecture to data
structures,

algorithms, or coding errors. The chance to start with something that already
works
removes the barrier to exploration: your program already works. If you want to
change it,


Post a reply to this message

From: Jim Holsenback
Subject: Re: 3.7xx: max_extent (re: image resolution) is missing something?
Date: 9 Jun 2017 08:16:06
Message: <593a9186$1@news.povray.org>
On 6/8/2017 1:26 PM, Kenneth wrote:
> (running 3.7.1 beta 8)
> In the in-built documentation "3.3.1.6.5 Functions"...
> 
> In the section "min_extent/max_extent', concerning the new 3.7xx feature of
> reading the pixel resolution of an image, the example given there seems to be
> missing something. Part of it is written like this...
> 
> ......
> #declare Resolution = max_extent ( MatteImage );
> #declare MatteNormalizationScale =
> ;

you are correct ... however look at 
http://wiki.povray.org/content/Reference:Vector_Expressions#Functions 
and the example is complete. Scroll down a bit further there is another 
example just after the "New" annotation regarding Df3NormalizationScale 
... they didn't make it into the docs most likely due to a foo somewhere 
with regex pattern matching in WikiDocGen. I'll have a look


Post a reply to this message

From: Jim Holsenback
Subject: Re: 3.7xx: max_extent (re: image resolution) is missing something?
Date: 9 Jun 2017 08:41:22
Message: <593a9772$1@news.povray.org>
On 6/9/2017 8:15 AM, Jim Holsenback wrote:
> ... they didn't make it into the docs most likely due to a foo somewhere 
> with regex pattern matching in WikiDocGen. I'll have a look

i take it back ... a quick look on the wiki and i think it's the markup 
concerning < and > that appear (and is missing in one place ... the box 
declaration) where > and < should have been used in the predefined 
text blocks that encloses the examples. this weekend i'll make some 
edits and test my theory.


Post a reply to this message

From: clipka
Subject: Re: 3.7xx: max_extent (re: image resolution) is missing something?
Date: 9 Jun 2017 12:19:27
Message: <593aca8f$1@news.povray.org>
Am 09.06.2017 um 14:41 schrieb Jim Holsenback:
> On 6/9/2017 8:15 AM, Jim Holsenback wrote:
>> ... they didn't make it into the docs most likely due to a foo
>> somewhere with regex pattern matching in WikiDocGen. I'll have a look
> 
> i take it back ... a quick look on the wiki and i think it's the markup
> concerning < and > that appear (and is missing in one place ... the box
> declaration) where > and < should have been used in the predefined
> text blocks that encloses the examples. this weekend i'll make some
> edits and test my theory.

I concur.

In most pre-formatted blocks, "<" and ">" are represented as "<" and
">", respectively, in both the original Wiki source text as well as
the compiled help file for POV-Ray for Windows; not so in the case of
the max_extent example: There, literal "<" and ">" are used in the Wiki
source, and also exported as such to the compiled help file.

The Wiki seems to be robust enough to display the text as intended, but
the help file viewer apparently misinterprets it as a (malformed) HTML
tag. The text is actually in the help file, but it's not displayed.


Post a reply to this message

From: Kenneth
Subject: Re: 3.7xx: max_extent (re: image resolution) is missing something?
Date: 9 Jun 2017 13:45:05
Message: <web.593add807cb8f4dc883fb31c0@news.povray.org>
Jim Holsenback <spa### [at] nothanksnet> wrote:

>
> you are correct ... however look at
> http://wiki.povray.org/content/Reference:Vector_Expressions#Functions
> and the example is complete.

Ah yes, thanks. I didn't think to look on-line, as I was running the latest
POV-Ray beta anyway, with the 'latest' help file.

Wow, I was woefully wrong about
            #declare MatteNormalizationScale = Resolution;

:-O


Post a reply to this message

From: Kenneth
Subject: Re: 3.7xx: max_extent (re: image resolution) is missing something?
Date: 9 Jun 2017 14:00:07
Message: <web.593ae15b7cb8f4dc883fb31c0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:

>
> In most pre-formatted blocks, "<" and ">" are represented as "<" and
> ">", respectively, in both the original Wiki source text as well as
> the compiled help file for POV-Ray for Windows; not so in the case of
> the max_extent example: There, literal "<" and ">" are used in the Wiki
> source, and also exported as such to the compiled help file.
>
> The Wiki seems to be robust enough to display the text as intended, but
> the help file viewer apparently misinterprets it as a (malformed) HTML
> tag. The text is actually in the help file, but it's not displayed.

If the included help file was 'just' HTML, I would fix it myself. But alas, it's
compiled :-(

(A little side note: I can actually open the help file--in its entirety-- in
Windoze Wordpad. The contents are meaningless of course, mostly symbols. But It
doesn't open likewise in POV-Ray-- just one little 'word.' I thought POV was
robust enough to open and display just about any 'programming language.' But
then again, I'm somewhat naive about 'compiled' languages ('somewhat'?? That's
an understatement!!) ;-)


Post a reply to this message

From: Kenneth
Subject: Re: 3.7xx: max_extent (re: image resolution) is missing something?
Date: 9 Jun 2017 14:15:02
Message: <web.593ae4e67cb8f4dc883fb31c0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

>
> I really liked the following excerpt from Graphics Gems 3:
>
> https://doc.lagout.org/Others/Game%20Development/Programming/Graphics%20Gems%203.pdf
>
> Since the first volume of Graphics Gems was published, I have spoken to many
> readers
> and discovered that these books have helped people learn graphics by starting
> with
> working codes and just exploring intuitively....

Yes, that's an excellent 'philosophy', about *anything* in life, actually. I
love to experiment, with anything and everything; it's a wonderful way to learn
new stuff. But as you (and the author) say, there needs to be a 'germ' of
understanding, to begin with. Sometimes that little germ is missing :-(


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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