|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I just ran into something strange. While trying to
pass a color vector through a macro, the color changed!
The code is simple
#include "Colors.inc" #include "finish.inc"
#declare CapColor=<1,0,0,0,0>;
#macro Cap(Color)
difference
{
union {
cylinder{<0,0,0>,<0,.0889,0>,.17}
cylinder{<0,.0889,0>,<0,.1333,0>,.2}
cylinder{0,y*.0667,.12 translate y*.1333}
}
pigment{ rgbft Color} //Will promote to a 5 component vector
}
#end
camera { location <0,5,-5> look_at 0 angle 40 }
light_source { 0,White translate -z*40 rotate <30,-10,0> }
background { White}
object { Cap(CapColor) }
If I #declare CapColor= a three or four component vector, it works fine.
But as a five component vector something doesn't work so well.
Can anyone give some insight on this?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
It certainly looks like a bug. I don't know of any way of printing the
values of the vector when it has five components so I can't see what's
happening. There seems to be no way to access the 5th component of a vector
and #write doesn't work for 5-dimensional vectors for some strange reason.
5-dimensional vectors are obviously handled differently from 4 or less
dimensinal vectors, and perhaps the bug is related to that.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In article <383e7611@news.povray.org> , Nieminen Juha
<war### [at] punarastascstutfi> wrote:
> It certainly looks like a bug. I don't know of any way of printing the
> values of the vector when it has five components so I can't see what's
> happening. There seems to be no way to access the 5th component of a vector
> and #write doesn't work for 5-dimensional vectors for some strange reason.
> 5-dimensional vectors are obviously handled differently from 4 or less
> dimensinal vectors, and perhaps the bug is related to that.
No, you can just treat it as a color:
#declare CapColor=<1,0,0,0,0>;
#macro Cap(Color)
difference
{
union {
cylinder{<0,0,0>,<0,.0889,0>,.17}
cylinder{<0,.0889,0>,<0,.1333,0>,.2}
cylinder{0,y*.0667,.12 translate y*.1333}
}
pigment{ rgbft Color} //Will promote to a 5 component vector
}
#warning "Vector <"
#warning str(Color.red,0,3)
#warning ", "
#warning str(Color.green,0,3)
#warning ", "
#warning str(Color.blue,0,3)
#warning ", "
#warning str(Color.filter,0,3)
#warning ", "
#warning str(Color.transmit,0,3)
#warning "> "
#end
camera { location <0,5,-5> look_at 0 angle 40 }
light_source { 0,rgb 0 translate -z*40 rotate <30,-10,0> }
background { rgb 0}
object { Cap(CapColor) }
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In article <383E7213.7DF63B99@gci.net> , "mr.art" <mr.### [at] gcinet> wrote:
> If I #declare CapColor= a three or four component vector, it works fine.
> But as a five component vector something doesn't work so well.
> Can anyone give some insight on this?
I can't reproduce it. My output is as expected (see my other post). Which
version of POV-Ray are you using?
Thorsten
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I have used the Official version 3.1g, the Superpatch, and UVPOV 6.1a
All with the same results.
Printing the vector information like you suggested in your other
post gave these results vector<0.000,1.875,0.000,0.000,0.000>
for the color vector <1.000,0.000,0.000,0.000,0.000>
I am using Win98, PII 400,128meg Ram
Thorsten Froehlich wrote:
>
> In article <383E7213.7DF63B99@gci.net> , "mr.art" <mr.### [at] gcinet> wrote:
>
> > If I #declare CapColor= a three or four component vector, it works fine.
> > But as a five component vector something doesn't work so well.
> > Can anyone give some insight on this?
>
> I can't reproduce it. My output is as expected (see my other post). Which
> version of POV-Ray are you using?
>
> Thorsten
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Here is more data to ponder:
#declare CapColor=<1,1,0,0>; outside the macro becomes <1,1,0,0> inside
But
#declare CapColor=<1,1,0,0,0>; becomes <0,1.875,0,1.875,0> inside
Thorsten Froehlich wrote:
>
> In article <383E7213.7DF63B99@gci.net> , "mr.art" <mr.### [at] gcinet> wrote:
>
> > If I #declare CapColor= a three or four component vector, it works fine.
> > But as a five component vector something doesn't work so well.
> > Can anyone give some insight on this?
>
> I can't reproduce it. My output is as expected (see my other post). Which
> version of POV-Ray are you using?
>
> Thorsten
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Try this for simplest code :
// #declare CapColor= <1,0,0,0,0>;
#declare CapColor= color <1,0,0,0,0>;
#warning "Vector <" #warning str(CapColor.red ,0,4)
#warning ", " #warning str(CapColor.green ,0,4)
#warning ", " #warning str(CapColor.blue ,0,4)
#warning ", " #warning str(CapColor.filter ,0,4)
#warning ", " #warning str(CapColor.transmit,0,4)
#warning "> "
sphere{0,0 pigment{color 0}}// keeps the error messages away
uncomment one or the other of the #declare statements.
#declare CapColor= color <1,0,0,0,0>; gives correct results
#declare CapColor= <1,0,0,0,0>; doesn't
So the problem seems to be not in the #macro stuff at all
but in the assignment process.
"mr.art" wrote:
>
> Here is more data to ponder:
> #declare CapColor=<1,1,0,0>; outside the macro becomes <1,1,0,0> inside
> But
> #declare CapColor=<1,1,0,0,0>; becomes <0,1.875,0,1.875,0> inside
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In article <383EDDEB.174731B4@gci.net> , "mr.art" <mr.### [at] gcinet> wrote:
> So the problem seems to be not in the #macro stuff at all
> but in the assignment process.
Yes, I can now verify your problem. It is a bug in the source code. A
detailed bug report has been posted to povray.bugreports.
Thorsten
____________________________________________________
Thorsten Froehlich
e-mail: mac### [at] povrayorg
I am a member of the POV-Ray Team.
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Thank you. I know that the easy workaround
is to use the keyword color in front of the vector.
But if someone had tried to 5d vectors for another
use, it could mess them up some. So, once again,
thank you.
Mr. Art
Thorsten Froehlich wrote:
>
> In article <383EDDEB.174731B4@gci.net> , "mr.art" <mr.### [at] gcinet> wrote:
>
> > So the problem seems to be not in the #macro stuff at all
> > but in the assignment process.
>
> Yes, I can now verify your problem. It is a bug in the source code. A
> detailed bug report has been posted to povray.bugreports.
>
> Thorsten
>
> ____________________________________________________
> Thorsten Froehlich
> e-mail: mac### [at] povrayorg
>
> I am a member of the POV-Ray Team.
> Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Fri, 26 Nov 1999 15:40:53 -0600, "Thorsten Froehlich"
<tho### [at] trfde> wrote:
>Yes, I can now verify your problem. It is a bug in the source code. A
>detailed bug report has been posted to povray.bugreports.
Thank you for posting the fix, Thorsten.
--
Alan - ako### [at] povrayorg - a k o n g <at> p o v r a y <dot> o r g
http://www.povray.org - Home of the Persistence of Vision Ray Tracer
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|