POV-Ray : Newsgroups : povray.newusers : I am stuck!! : Re: I am stuck!! Server Time
28 Jul 2024 22:24:03 EDT (-0400)
  Re: I am stuck!!  
From: Chris B
Date: 8 Jul 2007 05:16:10
Message: <4690ab5a$1@news.povray.org>
"quoderatd" <quo### [at] gmailcom> wrote in message 
news:web.4690288feb1a3c7d1c9e60d70@news.povray.org...
> Hello I have a question regarding Pov-Ray
>
> I'm trying to transform all coordinates of everything..
> Is there a way to change all x, y, z coordinates by a function of x, y, z?
>
> For example:
>
> there are two coordinates specified for a cylinder
>
> coordinate is <a, b, c><d, e, f> , i want it to translate it to <a, 0, 
> c><d,
> 0, f>
>
> and then rotate each coordinate by amount of <a, 0, 0> and the second by 
> <d,
> 0, 0>
>
> To phrase it differently:
> is there a way to just say tranlate <0, -y, 0>
> meaning everything (all the coordinates that are used) is to be translated
> on xz plane, but with x and z with same values.
>
> i didn't find a sort of global variable (probably it's called by a 
> different
> name) that i could alter so i can change each coordinate of all graphed
> points to be changed according to it's own coordinate.
>

Hi,

I don't think you'll find something in POV-Ray to transpose all points in a 
scene or object definition in the way you describe, but you can transpose 
individual points and you can write a macro to make it easier to transpose 
multiple points.

You can multiply <a,b,c> by <1,0,1> to get <a,0,c> or by <1,0,0> to get 
<a,0,0>.
See vrotate in the help for rotating one vector around the origin by a given 
amount (or vrotated if you want to use degrees rather than radians).

I cringe writing this because 'a' is a length and you're asking to use it as 
an angle, but what you asked for would come out to something like
 cylinder 
{vrotated(<a,b,c>*<1,0,1>,<a,b,c>*<1,0,0>),vrotated(<d,e,f>*<1,0,0>,<d,e,f>*<1,0,0>) 
.... }

If there are a lot of points that you wish to transpose then you may wish to 
look at creating a little macro to do it.

Regards,
Chris B.


Post a reply to this message

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