POV-Ray : Newsgroups : povray.newusers : transforming vectors Server Time
5 Nov 2024 09:26:51 EST (-0500)
  transforming vectors (Message 1 to 10 of 15)  
Goto Latest 10 Messages Next 5 Messages >>>
From: Daniel Pirch
Subject: transforming vectors
Date: 20 Oct 1999 03:00:53
Message: <380d68a5@news.povray.org>
Is it possible to apply a transformation to a single vector? (for instance
if my vector is <1,0,0> and my transformation is transformation is
transform{translate <2,0,0> rotate 90*z}, I want to get <0,3,0>)

--
Daniel Pirch
dpi### [at] gmxnet


Post a reply to this message

From: Jon A  Cruz
Subject: Re: transforming vectors
Date: 20 Oct 1999 03:07:40
Message: <380D6A78.FDCC4FBD@geocities.com>
Daniel Pirch wrote:

> Is it possible to apply a transformation to a single vector? (for instance
> if my vector is <1,0,0> and my transformation is transformation is
> transform{translate <2,0,0> rotate 90*z}, I want to get <0,3,0>)

Yes.

--
"My new computer's got the clocks, it rocks
But it was obsolete before I opened the box" - W.A.Y.


Post a reply to this message

From: Jon A  Cruz
Subject: Re: transforming vectors
Date: 20 Oct 1999 03:12:34
Message: <380D6B9F.E15489ED@geocities.com>
"Jon A. Cruz" wrote:

> Daniel Pirch wrote:
>
> > Is it possible to apply a transformation to a single vector? (for instance
> > if my vector is <1,0,0> and my transformation is transformation is
> > transform{translate <2,0,0> rotate 90*z}, I want to get <0,3,0>)
>
> Yes.

Now, to start guessing what you need, instead of just what you asked.  :-)

RT_M  ( http://wombat.doc.ic.ac.uk/foldoc/foldoc.cgi?query=RTM )


Check the docs (be sure to check the language help, not the Windows help) for
vector functions.


--
"My new computer's got the clocks, it rocks
But it was obsolete before I opened the box" - W.A.Y.


Post a reply to this message

From: Daniel Pirch
Subject: Re: transforming vectors
Date: 20 Oct 1999 05:10:28
Message: <380d8704@news.povray.org>
> > > Is it possible to apply a transformation to a single vector? (for
instance
> > > if my vector is <1,0,0> and my transformation is transformation is
> > > transform{translate <2,0,0> rotate 90*z}, I want to get <0,3,0>)
>
> Check the docs (be sure to check the language help, not the Windows help)
for
> vector functions.

Of course I've checked the docs before I posted my Question. I would never
ask before doing that :-)

But as vector functions, there are only vaxis_rotate, vcross, vnormalize and
vrotate. I asked if it's possible (and HOW) to transform a vector by an
already declared transformation. I can do this with an object:

#declare MyTrans = transform{translate ... rotate ... scale ... ...}

sphere{0,1 transform MyTrans}

But how can I do this with vector coordinates?

Thanks
Daniel Pirch

dpi### [at] gmxnet


Post a reply to this message

From: Nieminen Juha
Subject: Re: transforming vectors
Date: 20 Oct 1999 07:43:42
Message: <380daaee@news.povray.org>
Daniel Pirch <dpi### [at] gmxnet> wrote:
: I asked if it's possible (and HOW) to transform a vector by an
: already declared transformation.

  It's not possible.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Josh English
Subject: Re: transforming vectors
Date: 20 Oct 1999 10:47:39
Message: <380DD608.72926FC4@spiritone.com>
Check out http://users.erols.com/vansickl/macs.htm on that page there is a
vmatrix macro that applies  matrix tranformations to vectors, which will
accomplish what you want to do. His explanaion of how the Matrix command works
will help out, too.

Daniel Pirch wrote:

> > > > Is it possible to apply a transformation to a single vector? (for
> instance
> > > > if my vector is <1,0,0> and my transformation is transformation is
> > > > transform{translate <2,0,0> rotate 90*z}, I want to get <0,3,0>)
> >
> > Check the docs (be sure to check the language help, not the Windows help)
> for
> > vector functions.
>
> Of course I've checked the docs before I posted my Question. I would never
> ask before doing that :-)
>
> But as vector functions, there are only vaxis_rotate, vcross, vnormalize and
> vrotate. I asked if it's possible (and HOW) to transform a vector by an
> already declared transformation. I can do this with an object:
>
> #declare MyTrans = transform{translate ... rotate ... scale ... ...}
>
> sphere{0,1 transform MyTrans}
>
> But how can I do this with vector coordinates?
>
> Thanks
> Daniel Pirch
>
> dpi### [at] gmxnet

--

Josh English
eng### [at] spiritonecom
icq 1946299
"Stress is when you wake up screaming and realize you haven't fallen asleep
yet."


Post a reply to this message

From: Margus Ramst
Subject: Re: transforming vectors
Date: 20 Oct 1999 10:57:28
Message: <380DD822.24D08595@peak.edu.ee>
It is not possible directly. You can facilitate the process by predeclarin
transformation vectors. Keep in mind the following:

object                 vector
------                 ------
scale <x,y,z>          vector * <x,y,z>
rotate <x,y,z>         vrotate(vector, <x,y,z>)
translate <x,y,z>      vector + <x,y,z>

Now declare, for example, a rotation vector, and use it both after the 'rotate'
keyword and in the 'vrotate' function.

Margus

Daniel Pirch wrote:
> 
> 
> Of course I've checked the docs before I posted my Question. I would never
> ask before doing that :-)
> 
> But as vector functions, there are only vaxis_rotate, vcross, vnormalize and
> vrotate. I asked if it's possible (and HOW) to transform a vector by an
> already declared transformation. I can do this with an object:
> 
> #declare MyTrans = transform{translate ... rotate ... scale ... ...}
> 
> sphere{0,1 transform MyTrans}
> 
> But how can I do this with vector coordinates?
> 
> Thanks
> Daniel Pirch
> 
> dpi### [at] gmxnet


Post a reply to this message

From: Chris Huff
Subject: Re: transforming vectors
Date: 20 Oct 1999 17:11:32
Message: <380E308B.72F15F42@yahoo.com>
This is why I made a patch which added a vtransform() function. :-)

vtransform(TRANSFORM, VECTOR)
Returns a vector which is the result of applying transformation
TRANSFORM to the vector VECTOR.


Post a reply to this message

From: Chris Huff
Subject: Re: transforming vectors
Date: 20 Oct 1999 21:04:56
Message: <380E673F.ACE177DD@yahoo.com>
Forgot to add this:
I will be posting the source for this in povray.programming sometime
soon, and I have sent it to Ron Parker. The disadvantage is that you
will either have to use an unofficial version, or wait until it gets
into the official POV-Ray(if it ever does...maybe POV-Ray 3.5?).


Post a reply to this message

From: Ken
Subject: Re: transforming vectors
Date: 20 Oct 1999 21:08:02
Message: <380E6706.7BC65228@pacbell.net>
Chris Huff wrote:
> 
> Forgot to add this:
> I will be posting the source for this in povray.programming sometime
> soon, and I have sent it to Ron Parker. The disadvantage is that you
> will either have to use an unofficial version, or wait until it gets
> into the official POV-Ray(if it ever does...maybe POV-Ray 3.5?).

  It almost seems to be a race now if there will be an updated version
of the SuperPatch before the official Pov v3.5 will become available.

 Any comments Ron ?


-- 
Ken Tyler -  1100+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

Goto Latest 10 Messages Next 5 Messages >>>

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