POV-Ray : Newsgroups : povray.general : never noticed this before... : never noticed this before... Server Time
29 Jul 2024 06:23:27 EDT (-0400)
  never noticed this before...  
From: Anthony D  Baye
Date: 6 Oct 2012 21:25:01
Message: <web.5070d99de3c69d3bd97ee2b90@news.povray.org>
It's not a major issue, since the next release is probably going to be 4.0, but
I just noticed that translate doesn't discriminate between 2d and 3d vectors. I
don't know if this is an intentional behavior or not.

I was trying to figure out why turning off ambient reflection in my finish
blocks was blacking out my scene, and didn't notice the missing comma in my
light_source location vector:

#declare ft = 12;

// before
light_source {
     0*x
     rgb 1
     translate <20.0, 50.0 -75.0>*ft
     }

// after...
light_source {
     0*x
     rgb 1
     translate <20.0, 50.0, -75.0>*ft
     }

oops...

I suspect that the reason this doesn't give an error is because of
vector-promotion, but shouldn't there be cases where vectors aren't promoted, or
is it too difficult to promote scalars, but disallow 2d vectors?

without digging through the code myself to see how the promotion is handled, I
couldn't say.

Although I must admit that, even if I can't see a reason to use a 2d vector in a
translate statement, that one doesn't exist.  Feel free to enlighten me.

regards,
A.D.B.


Post a reply to this message

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