POV-Ray : Newsgroups : povray.general : A bit of math : Re: A bit of math Server Time
24 Apr 2024 14:29:36 EDT (-0400)
  Re: A bit of math  
From: clipka
Date: 27 Feb 2018 05:46:33
Message: <5a953709$1@news.povray.org>
Am 27.02.2018 um 03:15 schrieb Bald Eagle:
> Mike Horvath <mik### [at] gmailcom> wrote:
> 
>> I get an error when I try to set the value of a vector's x-coordinate.
>>
>>  #local NearCorner.x = BBoxMin.x;
>>
>> What is the correct way to set this coordinate?
> 
> #local NearCorner = <BBoxMin.x, BBoxMin.y, BBoxMin.z>;
> 
> or
> 
> #local NearCorner = NearCorner + <BBoxMin.x, 0, 0>;

Neither will do what Mike presumably expects to happen; the former would
set all coordinates of NearCorner to those from BBoxMin, while the
latter would /increase/ NearCorner.x by BBoxMin.x rather than replace
the value.

To really just replace NearCorner's x coordinate, use:

    #local NearCorner = <BBoxMin.x, NearCorner.y, NearCorner.z>;

or:

    #local NearCorner = NearCorner*<0,1,1> + BBoxMin*<1,0,0>;


Post a reply to this message

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