POV-Ray : Newsgroups : povray.newusers : Get only x or y or z coordinate of a vector Server Time
14 May 2024 07:08:57 EDT (-0400)
  Get only x or y or z coordinate of a vector (Message 1 to 3 of 3)  
From: huiakso
Subject: Get only x or y or z coordinate of a vector
Date: 3 Dec 2012 11:45:01
Message: <web.50bcd6dd85448a3dffcbc3c0@news.povray.org>
Is there no easy way to do that?

Something like:
#declare P1 = <1, 2, 3>
print(P1.y)
=> 2


Or do i have to maintain an extra array to achieve something like that?


Post a reply to this message

From: Warp
Subject: Re: Get only x or y or z coordinate of a vector
Date: 3 Dec 2012 12:14:12
Message: <50bcdde4@news.povray.org>
huiakso <huiakso> wrote:
> Is there no easy way to do that?

> Something like:
> #declare P1 = <1, 2, 3>
> print(P1.y)
> => 2

Have you actually *tried* to use "P1.y"? Because it should work exactly
like that.

-- 
                                                          - Warp


Post a reply to this message

From: Stephen
Subject: Re: Get only x or y or z coordinate of a vector
Date: 3 Dec 2012 13:19:32
Message: <50bced34$1@news.povray.org>
On 03/12/2012 5:14 PM, Warp wrote:
> huiakso <huiakso> wrote:
>> Is there no easy way to do that?
>
>> Something like:
>> #declare P1 = <1, 2, 3>
>> print(P1.y)
>> => 2
>
> Have you actually *tried* to use "P1.y"? Because it should work exactly
> like that.
>
It does work like that. I am using it in my current project.

e.g.

#declare BoxMax = max_extent (Trace_patch_aa_);
...

#while (Num_z <= BoxMax.z)
...


-- 
Regards
     Stephen


Post a reply to this message

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