POV-Ray : Newsgroups : povray.newusers : I am stuck!! Server Time
25 Dec 2024 11:14:25 EST (-0500)
  I am stuck!! (Message 1 to 3 of 3)  
From: quoderatd
Subject: I am stuck!!
Date: 7 Jul 2007 20:00:02
Message: <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.


Post a reply to this message

From: Chris B
Subject: Re: I am stuck!!
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

From: Tim Attwood
Subject: Re: I am stuck!!
Date: 9 Jul 2007 05:27:32
Message: <4691ff84$1@news.povray.org>
What do you really want to acomplish?

You could use an orthograpic camera if you really
want a flat looking image, (all points translated to y=0?)

Or you could #declare a tranform for later use.
#declare Foo = transform{translate <...> rotate <...>};
object {Scene transform{Foo}}

Or you could #declare your control points.
#declare CylA = <...>;
#declare CylB = <...>;
cylinder {CylA,CylB,R}// original
cylinder {<CylA.x,0,CylA.z>,<CylB.x,0,CylB.z>,R}// z ignored

Etc.


Post a reply to this message

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