 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
It is interesting that when I do a #debug for a variable which I have
declared as [ #declare angie=2^3*4^4;]
povray tells me it is 1084576, when I paste this text (2^3*4^4) into
Lotus1-2-3, the result is 2048.
The Lotus 1-2-3 answer is based on the hierarchy of operators I remember
from grade school. Is povray's hierarchy of operators like that of C or
is it "new"?
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Wed, 29 Nov 2000 16:05:50 -0500, Greg M. Johnson wrote:
>It is interesting that when I do a #debug for a variable which I have
>declared as [ #declare angie=2^3*4^4;]
>povray tells me it is 1084576, when I paste this text (2^3*4^4) into
>Lotus1-2-3, the result is 2048.
>
>The Lotus 1-2-3 answer is based on the hierarchy of operators I remember
>from grade school. Is povray's hierarchy of operators like that of C or
>is it "new"?
How did you do that? POV doesn't have a ^ operator.
--
Ron Parker http://www2.fwi.com/~parkerr/traces.html
My opinions. Mine. Not anyone else's.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ron Parker wrote:
> How did you do that? POV doesn't have a ^ operator.
MegaPov does in the isosurface feature.
--
Ken Tyler
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Wed, 29 Nov 2000 13:32:20 -0800, Ken wrote:
>
>
>Ron Parker wrote:
>
>> How did you do that? POV doesn't have a ^ operator.
>
>MegaPov does in the isosurface feature.
Yes, but he said he used #declare.
--
Ron Parker http://www2.fwi.com/~parkerr/traces.html
My opinions. Mine. Not anyone else's.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <slr### [at] fwi com>, ron### [at] povray org
wrote:
> Yes, but he said he used #declare.
I wrote a patch which allows it to be used outside isosurface functions
as well. However, it doesn't do the precedence right, and I am not
certain how to fix it.
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 29 Nov 2000 16:45:34 -0500, Ron Parker wrote:
>On Wed, 29 Nov 2000 13:32:20 -0800, Ken wrote:
>>
>>
>>Ron Parker wrote:
>>
>>> How did you do that? POV doesn't have a ^ operator.
>>
>>MegaPov does in the isosurface feature.
>
>Yes, but he said he used #declare.
Ah, I see. It's been added to express.c in MegaPOV as well as to the isosurf
stuff. It wasn't added correctly, though; it has the same precedence as
multiply and divide. We'll need to make sure that gets fixed in 3.5.
--
Ron Parker http://www2.fwi.com/~parkerr/traces.html
My opinions. Mine. Not anyone else's.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 29 Nov 2000 16:53:30 -0500, Ron Parker wrote:
>Ah, I see. It's been added to express.c in MegaPOV as well as to the isosurf
It's worth noting that this is not a question for .general. If you're
using MegaPOV, and you're using a feature that isn't in the current official
version of POV-Ray or that works differently in the current official version
of POV-Ray, you should at least say so, and you should seriously consider
asking in the unofficial.patches newsgroup instead.
Is this in the "Welcome to the POV-Ray newsgroups" thingie in p.a.f-a-q?
--
Ron Parker http://www2.fwi.com/~parkerr/traces.html
My opinions. Mine. Not anyone else's.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ron Parker wrote:
> Is this in the "Welcome to the POV-Ray newsgroups" thingie in p.a.f-a-q?
Generally but not specifically.
--
Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ken wrote:
>
> Ron Parker wrote:
>
> > Is this in the "Welcome to the POV-Ray newsgroups" thingie in p.a.f-a-q?
>
> Generally but not specifically.
Actually it is specific -
"*Unofficial Patches Group
There is an unofficial patches group where discussions on using other
peoples modified versions of POV-Ray are held."
--
Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Greg M. Johnson" wrote:
>
> It is interesting that when I do a #debug for a variable which I have
> declared as [ #declare angie=2^3*4^4;]
> povray tells me it is 1084576, when I paste this text (2^3*4^4) into
> Lotus1-2-3, the result is 2048.
>
> The Lotus 1-2-3 answer is based on the hierarchy of operators I remember
> from grade school. Is povray's hierarchy of operators like that of C or
> is it "new"?
When in doubt use parenthesis. They rule.
--
Brought to you by Weyland-Yutani
Making Space a better Place to Scream.
-- The Iron Webmaster, 255
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ron Parker wrote:
> It's worth noting that this is not a question for .general.
Okeleeedoke. I expected a criticsm for not putting this in povray.advanced-users,
since it's a math question, but then again povray.new-users since it's a stupidly
simply one, or even povray.off-topic, but the experts like Ron aren't subscribed
to that anymore, AND I didn't realize that the ^ was inoperative for general
declarations in 3.1g.
:-|
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In perl I get:
my $Calculator = 2^3*4^4;
print "$Calculator\n\n";
This prints 10
$Calculator = (2^3*4^4);
print "$Calculator\n\n";
This prints 10
$Calculator = (2^3)*(4^4);
print "$Calculator\n\n";
This prints 0
$Calculator = ((2^3)*(4^4));
print "$Calculator\n\n";
This prints 0
$Calculator = 2^(3*4)^4;
print "$Calculator\n\n";
This prints 10
--
Cheers
Steve email mailto:ste### [at] zeropps uklinux net
%HAV-A-NICEDAY Error not enough coffee 0 pps.
web http://www.zeropps.uklinux.net/
or http://start.at/zero-pps
10:55pm up 50 days, 1:19, 2 users, load average: 1.08, 1.09, 1.03
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Steve wrote:
> In perl I get:
>
> my $Calculator = 2^3*4^4;
> print "$Calculator\n\n";
>
> This prints 10
> [snip]
Looks like you need to reread perlop. The caret (^) in Perl is the
bitwise exclusive or. Using ** will give you the expected answers.
HTH,
-Alex V.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Greg M. Johnson" wrote:
>
> Ron Parker wrote:
>
> > It's worth noting that this is not a question for .general.
>
> Okeleeedoke. I expected a criticsm for not putting this in povray.advanced-users,
> since it's a math question, but then again povray.new-users since it's a stupidly
> simply one, or even povray.off-topic, but the experts like Ron aren't subscribed
> to that anymore, AND I didn't realize that the ^ was inoperative for general
> declarations in 3.1g.
Don't let it upset you too much. I think Ron is just having a bad hair day.
*BUT* he does bring up a valid point. Whenever an inconsistency arises
in one of the unofficial versions of the program they should indeed be
discussed in the unofficial patches group. That fact you were using
MegaPov when the problem occured should have been your first clue on
where to post the message. A good reason for this is when someone like
Ron, a member of the POV-Team, sees a question like this arise he may
be tempted to spend time looking at the source code for POV-Ray and try
to understand where the inconstancy lies. If he wastes his time looking
in the official source code, for problems that don't apply to it, he may
not be so generous next time trying to be of help. It is a matter of
courtesy to him, and the other Team members who monitor and maintain
these groups, to try to help keep them organized and on topic.
--
Ken Tyler
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Wed, 29 Nov 2000 19:41:21 -0800, Ken wrote:
>Don't let it upset you too much. I think Ron is just having a bad hair day.
Well, yes... annual performance reviews at work and all. The good news
is, I still have a job. :)
>Ron, a member of the POV-Team, sees a question like this arise he may
>be tempted to spend time looking at the source code for POV-Ray and try
>to understand where the inconstancy lies. If he wastes his time looking
And that's exactly what I did; I spent several minutes grepping for
HAT_TOKEN and not finding anything. It's just as well, though: the
new functionality has been merged into 3.5, so it needs to be fixed
there.
--
Ron Parker http://www2.fwi.com/~parkerr/traces.html
My opinions. Mine. Not anyone else's.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ron Parker wrote:
> >Ron, a member of the POV-Team, sees a question like this arise he may
> >be tempted to spend time looking at the source code for POV-Ray and try
> >to understand where the inconstancy lies. If he wastes his time looking
>
> And that's exactly what I did; I spent several minutes grepping for
> HAT_TOKEN and not finding anything. It's just as well, though: the
> new functionality has been merged into 3.5, so it needs to be fixed
> there.
Sorry mons.
I guess I thought the introduction of ^ was so cool and so necessary [as opposed
to pow(a,b)] that I forgot it wasn't in 3.1g.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Matt Giwer wrote:
> When in doubt use parenthesis. They rule.
I was going so wacky with parens that I was second-guessing myself and adding
2 or 3 extra pairs to every equation.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Greg M. Johnson" wrote:
>
> It is interesting that when I do a #debug for a variable which I have
> declared as [ #declare angie=2^3*4^4;]
> povray tells me it is 1084576, when I paste this text (2^3*4^4) into
> Lotus1-2-3, the result is 2048.
Just out of curiosity if you know the answer is 2048 why don't you
just put 2048 in as your declared value ? Sure would make your
code more readable.
<duck>
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Greg M. Johnson" wrote:
>
> Matt Giwer wrote:
>
> > When in doubt use parenthesis. They rule.
>
> I was going so wacky with parens that I was second-guessing myself and adding
> 2 or 3 extra pairs to every equation.
It is worth it to remove all doubt and certainly faster than working
through the evaluation hierarchy if it isn't second nature to you.
--
I would rather hide behind freedom of speech than
behind maudlin self-righteousness.
-- Cabell W. Johnson, 7
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ken <tyl### [at] pacbell net> wrote:
: Just out of curiosity if you know the answer is 2048 why don't you
: just put 2048 in as your declared value ? Sure would make your
: code more readable.
Sometimes putting the result is less readable than putting the calculation
used to get the result.
For example, I bet that this:
sphere { <1,2,3>*.25, 10*.25 }
tells you more about what is happening than this:
sphere { <.25, .5, .75>, 2.5 }
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
> For example, I bet that this:
>
> sphere { <1,2,3>*.25, 10*.25 }
>
> tells you more about what is happening than this:
>
> sphere { <.25, .5, .75>, 2.5 }
That is an absurd presumption. Why should I have to sit here and
mentally calculate values when absolutes are instantly readable ?
--
Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Thu, 30 Nov 2000 15:27:06 -0800, Ken wrote:
>
>
>Warp wrote:
>
>> For example, I bet that this:
>>
>> sphere { <1,2,3>*.25, 10*.25 }
>>
>> tells you more about what is happening than this:
>>
>> sphere { <.25, .5, .75>, 2.5 }
>
>That is an absurd presumption. Why should I have to sit here and
>mentally calculate values when absolutes are instantly readable ?
Which is more readable and conveys my intent better?
color_map {
[ 1/7 color red 1 ]
[ 1/7 color red 1 green .5]
[ 2/7 color red 1 green .5]
[ 2/7 color red 1 green 1]
...
}
or
color_map {
[ 0.14285714 color red 1]
[ 0.14285714 color red 1 green .5]
[ 0.28571428 color red 1 green .5]
[ 0.28571428 color red 1 green 1]
...
}
--
Ron Parker http://www2.fwi.com/~parkerr/traces.html
My opinions. Mine. Not anyone else's.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <slr### [at] fwi com>, ron### [at] povray org
wrote:
> Which is more readable and conveys my intent better?
Not to mention:
2*pi vs. 6.283185
sqrt(2) vs. 1.414213
pow(A, B) or A^B where either A or B (or both) is a variable.
Then there is anything using sin(), cos(), etc...
sin(45) is much more readable than 0.707106, or even sqrt(2)/2, and so
on...not to mention the precision you gain from having POV calculate it.
And what if you need something to vary with a loop? Sure, you *could*
calculate each object manually...but that definitely wouldn't be more
readable.
Also, expressions like <...>*SomeValue can be very useful for making
quick adjustments, I often use them when positioning my camera...why
should I do the math myself if I can just tell POV to do it? If I want
to keep the same angle to the origin but change the distance, I just
multiply the location by a scaling value, that way I only have to mess
with one number instead of doing the multiplication of the three vector
components.
It would be absurd to say that raw numbers are always easier to read
than simple expressions.
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ken <tyl### [at] pacbell net> wrote:
: That is an absurd presumption. Why should I have to sit here and
: mentally calculate values when absolutes are instantly readable ?
You don't need to calculate the result. You only need to understand where
does the expression come from.
For example, if a cylinder is located at <1,2,3> and another cylinder is
located at <7,8,9>, putting a sphere exactly half-way in the middle of them
is easier to do and understand by writing (<1,2,3>+<7,8,9>)/2 than writing
the result. The result will probably not tell you anything (perhaps you
could guess that it's somewhere between the two cylinders, but you couldn't
be sure without making that calculation anyways).
3/7 is a lot more clear than 0.4285714285
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
>
> Ken <tyl### [at] pacbell net> wrote:
> : That is an absurd presumption. Why should I have to sit here and
> : mentally calculate values when absolutes are instantly readable ?
>
> You don't need to calculate the result. You only need to understand where
> does the expression come from.
I won't concede my point of view nor will I argue it with you.
--
Ken Tyler
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ken <tyl### [at] pacbell net> wrote:
: I won't concede my point of view nor will I argue it with you.
Could you please tell me how did I calculate this number?
12.1243556529821410546921241
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ken wrote:
> Just out of curiosity if you know the answer is 2048 why don't you
> just put 2048 in as your declared value ? Sure would make your
> code more readable.
> <duck>
I)
For my fractal animation ("Warp's Julia Island Forest in Winter,") I
explored 11.85 orders of magnitude in camera angle. My variable for the
camera angle went something like (roughly from memory):
#declare angie=1.2*10^(1-11.85*clock);
Then I could set up a zooming animation, just debugging out the value of
angie with each frame.
II)
Another application involved using the cells pigment in an isosurface to
make a city. The max gradient value has a huge effect on the "quality" of
the image (the diffuse==0 problem for step functions in isosurfaces). I
set up an animation with a variable for max gradient called
#declare maxie=1.2^(33*clock+1);
and added a text object to the animation (roughly from memory)
text_object{"timrom.ttf",str(maxie,3,1),1,0 //blahblahblah
The result was my own tutorial showing me the effect of the max gradient on
the quality of the image.
Oops--this should have gone in p.u.p. :-|
:)
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Matt Giwer wrote:
> It is worth it to remove all doubt and certainly faster than working
> through the evaluation hierarchy if it isn't second nature to you.
The point was that the evaluation hierarchy in not correct in MP0.5a. For a while
I was fearing that the pov-team and/or the creators of the C language knew of some
kind of "smarter-persons'-hierarchy-they-only-teach-you-in-computer-science."
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
>
> Could you please tell me how did I calculate this number?
>
> 12.1243556529821410546921241
>
Perhaps the same way I got this number?
18.646427654437621998744
But you've already lost the debate to Ken's superior tactics :)
--
Margus Ramst
Personal e-mail: mar### [at] peak edu ee
TAG (Team Assistance Group) e-mail: mar### [at] tag povray org
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Margus Ramst wrote:
>
> Warp wrote:
> >
> > Could you please tell me how did I calculate this number?
> >
> > 12.1243556529821410546921241
> >
>
> Perhaps the same way I got this number?
> 18.646427654437621998744
This one is easy. It was calculated with an electronic calculating
device.
> But you've already lost the debate to Ken's superior tactics :)
:)
--
Ken Tyler
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ken wrote:
> > But you've already lost the debate to Ken's superior tactics :)
> :)
And then he lost with my 8:28 AM posting.....
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ken wrote:
> Warp wrote:
>
> > For example, I bet that this:
> >
> > sphere { <1,2,3>*.25, 10*.25 }
> >
> > tells you more about what is happening than this:
> >
> > sphere { <.25, .5, .75>, 2.5 }
>
> That is an absurd presumption. Why should I have to sit here and
> mentally calculate values when absolutes are instantly readable ?
So I suppose the prime factorization of 239 is 239.
--
David Fontaine <dav### [at] faricy net> ICQ 55354965
My raytracing gallery: http://davidf.faricy.net/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ken wrote:
>
> This one is easy. It was calculated with an electronic calculating
> device.
>
You give me more credit than I deserve. I just utilized my internal random
number generator :)
Did someone just say "lame joke"?
--
Margus Ramst
Personal e-mail: mar### [at] peak edu ee
TAG (Team Assistance Group) e-mail: mar### [at] tag povray org
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |