POV-Ray : Newsgroups : povray.newusers : Translating a "point" Server Time
21 Dec 2024 08:25:37 EST (-0500)
  Translating a "point" (Message 1 to 7 of 7)  
From: Bald Eagle
Subject: Translating a "point"
Date: 28 Feb 2016 17:15:01
Message: <web.56d370be14d864ee5e7df57c0@news.povray.org>
Er,
So I'm posting this in the New Users section, because it's likely to be
something that helps those trying to figure out the basics, and because it's one
of those simple things that I OUGHT to know, and likely have already used in the
past, but forgotten. <rolls eyes>  <hangs head>

I'd like to take a "point" (a vector), like <1, 2, 3> and "translate it" to "be
at" another place.

I wasn't sure if there was a vector function like vrotate that would be called
"vtranslate" or something that did this.  My brain is just _not_ currently in
"POV mode" and I figured it would take someone a single minute to set me
straight.

I'll likely spend the rest of the evening re-schooling myself in the ways of the
Vector Jedi.

Thanks!


Post a reply to this message

From: tth
Subject: Re: Translating a "point"
Date: 28 Feb 2016 18:06:04
Message: <56d37d5c$1@news.povray.org>
On 02/28/2016 11:12 PM, Bald Eagle a dit:

> I'd like to take a "point" (a vector), like <1, 2, 3> and "translate it" to "be
> at" another place.

     <-55, 45,  34> + <100, 500, 100>


-- 
http://weblog.mixart-myrys.org/?post/2016/02/THSF-V7


Post a reply to this message

From: Bald Eagle
Subject: Re: Translating a "point"
Date: 28 Feb 2016 18:20:00
Message: <web.56d3800e9941424f5e7df57c0@news.povray.org>
tth <tth### [at] noneinvalid> wrote:
>      <-55, 45,  34> + <100, 500, 100>

Thanks.   I finally figured that out.
I think things got clouded by my recollection of doing:

object { obj translate vrotate(<Translation_1, Translation_2, Translation_3>,
<30, 60, 90>) }

Thanks for chiming in with the obvious vector addition!   :)


Post a reply to this message

From: Alain
Subject: Re: Translating a "point"
Date: 28 Feb 2016 18:25:09
Message: <56d381d5$1@news.povray.org>

> Er,
> So I'm posting this in the New Users section, because it's likely to be
> something that helps those trying to figure out the basics, and because it's one
> of those simple things that I OUGHT to know, and likely have already used in the
> past, but forgotten. <rolls eyes>  <hangs head>
>
> I'd like to take a "point" (a vector), like <1, 2, 3> and "translate it" to "be
> at" another place.
>
> I wasn't sure if there was a vector function like vrotate that would be called
> "vtranslate" or something that did this.  My brain is just _not_ currently in
> "POV mode" and I figured it would take someone a single minute to set me
> straight.
>
> I'll likely spend the rest of the evening re-schooling myself in the ways of the
> Vector Jedi.
>
> Thanks!
>
>

Translating a point is just the addition of some displacement to that point.
You can also do a scalling like operation by multiplying that point by 
something like:
<1,2,3>*<8,7,6> is equivalent to scale <8,7,6>


Post a reply to this message

From: Bald Eagle
Subject: Re: Translating a "point"
Date: 28 Feb 2016 19:35:06
Message: <web.56d391189941424f5e7df57c0@news.povray.org>
Alain <kua### [at] videotronca> wrote:

> Translating a point is just the addition of some displacement to that point.
> You can also do a scalling like operation by multiplying that point by
> something like:
> <1,2,3>*<8,7,6> is equivalent to scale <8,7,6>

Right, it's easy and simple once you see the solution clearly.
I was (as usual) trying to overcomplicate it.
I had "translate" in my head, and wanted to put a vector into a statement, but
"points" are not POV-Ray primitives, and I was trying to use obj { translate {
.....   arrrrrgggghhhh.

Then I walked away from it for a bit, and I disabused my mind of that.

Though in some way it seems like it ought to be possible to do exactly that...


Post a reply to this message

From: clipka
Subject: Re: Translating a "point"
Date: 29 Feb 2016 01:03:49
Message: <56d3df45$1@news.povray.org>
Am 29.02.2016 um 01:30 schrieb Bald Eagle:
> Alain <kua### [at] videotronca> wrote:
> 
>> Translating a point is just the addition of some displacement to that point.
>> You can also do a scalling like operation by multiplying that point by
>> something like:
>> <1,2,3>*<8,7,6> is equivalent to scale <8,7,6>
> 
> Right, it's easy and simple once you see the solution clearly.
> I was (as usual) trying to overcomplicate it.
> I had "translate" in my head, and wanted to put a vector into a statement, but
> "points" are not POV-Ray primitives, and I was trying to use obj { translate {
> ......   arrrrrgggghhhh.
> 
> Then I walked away from it for a bit, and I disabused my mind of that.
> 
> Though in some way it seems like it ought to be possible to do exactly that...

Well, you _can_ use:

#declare MyTransform = transform { translate { ... } }
#declare Foo2 = vtransform(Foo1,MyTransform);


Post a reply to this message

From: Bald Eagle
Subject: Re: Translating a "point"
Date: 16 Mar 2016 22:20:01
Message: <web.56ea132b9941424f5e7df57c0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:

> #declare MyTransform = transform { translate { ... } }
> #declare Foo2 = vtransform(Foo1,MyTransform);

Thanks again for this - it's a useful little tool for working out a number of
things I've been toying with.  I'm using it for at least the 3rd or 4th time
I've asked - for both translations and rotations :)


Post a reply to this message

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