POV-Ray : Newsgroups : povray.newusers : Translating question : Re: Translating question Server Time
29 Jul 2024 16:26:47 EDT (-0400)
  Re: Translating question  
From: Oleguer Vilella
Date: 25 Jun 2005 09:11:59
Message: <42bd581f$1@news.povray.org>
Hi Mike,

Yeah, I understand it.

The directive that you've used is to find to director vector between two 
points (A and B).

On the documentation they say that:
"Returns a unit length vector that is the same direction as A."

Thank you very much for the answer.

Regards,
Oleguer




news:jEOr+CA5iTvCFw+h### [at] econymdemoncouk...
> Wasn't it Oleguer Vilella who wrote:
>>I'm trying to move this object along the z axis, but when I write 
>>"translate
>><5, 0, 9>", it also moves along the y axis.
>>I've rotated on the z and y axis. Could be there the problem?
>>
>>One thing I could do is if I translate it along the z axis 9 units, move 
>>it
>>in the same time -9 units along the y axis.
>
> The object is moving along the actual z axis. The only odd thing is that
> you've placed the camera high overhead, so you're getting an overhead
> view, and the z axis is up the screen.
>
> If that's not clear to you, try temporarily adding a visual
> representation of the three axes to the scene
>  cylinder {-x*15,x*15 0.3 pigment {rgb <1,0,0>}}
>  cone     {x*15,0.6, x*18,0 pigment {rgb <1,0,0>}}
>  cylinder {-y*15,y*15 0.3 pigment {rgb <0,1,0>}}
>  cone     {y*15,0.6, y*18,0 pigment {rgb <0,1,0>}}
>  cylinder {-z*15,z*15 0.3 pigment {rgb <0,0,1>}}
>  cone     {z*15,0.6, z*18,0 pigment {rgb <0,0,1>}}
> and you'll see that a motion along the z axis is in the direction of the
> z-axis arrow (blue) which is in a sort of nort-north-west direction on
> the screen.
>
>
> If you change your camera position to something more usual, like
>  camera { location  <7, 3, -10> look_at   <5, 3, 0> }
> then motion in the z direction moves away from the camera.
>
>
> If you want to retain your current camera position and move the object
> away from the camera then you can calculate the camera view direction
> like this
>
>  #declare Direction =  vnormalize(<5, 3.0,  0.0> - <7, 25, -10>);
>
> And then add a movement in that direction to the translate.
>
>  translate <5, 0, 0> + Direction*9
>
> -- 
> Mike Williams
> Gentleman of Leisure


Post a reply to this message

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