|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Where can I retrieve the new position after a rotation (or transformation in
general) of a point (let's say a center of a sphere or box) when I need that for
future references or calculations?
Paul
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Le 11/04/2014 23:05, pbrants nous fit lire :
> Where can I retrieve the new position after a rotation (or transformation in
> general) of a point (let's say a center of a sphere or box) when I need that for
> future references or calculations?
>
> Paul
>
>
use vtransform from transforms.inc.
vtransform(vec, trans)
See also:
> http://wiki.povray.org/content/Documentation:Tutorial_Section_2.2#Transformations
and
> http://wiki.povray.org/content/Reference:Transforms.inc
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"pbrants" <pbr### [at] telenetbe> wrote:
> Where can I retrieve the new position after a rotation (or transformation in
> general) of a point (let's say a center of a sphere or box) when I need that for
> future references or calculations?
Hi Paul,
min_extent() & max_extent() will give you the bounding box of an object, and
with that info you can find its center.
You can also use vrotate() to rotate a vector. For every transformation you give
your object, transform a vector. This is useful whenever min_extent() &
max_extent() won't give you accurate results (which can happen if you've used a
lot of CSG), or if you want to keep track of say, a specific corner of a box.
Sam
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Thanks for the suggestions! I think I can figure it out now.
Paul
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> Thanks for the suggestions! I think I can figure it out now.
>
> Paul
>
>
>
Also, for the translate: Just add the translation vector to your
location vector.
Alain
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"pbrants" <pbr### [at] telenetbe> wrote:
> Where can I retrieve the new position after a rotation (or transformation in
> general) of a point (let's say a center of a sphere or box) when I need that for
> future references or calculations?
>
> Paul
Hi I use this formula for retrieve the end point of a segment with 0-0-0 origin
leght=3,5 and rotation xrot-yrot-zrot
//rot x-y
#declare yt = 3.5* ( cos( radians(xrot) ) );
#declare xt = 3.5* ( sin( radians(yrot) ) * sin(radians(xrot) ) );
#declare zt = 3.5* ( cos( radians(yrot) ) * sin(radians(xrot) ) );
//rot xyz
#local yt1 = xt*sin( radians(zrot) ) + yt*cos( radians(zrot) ) ;
#local xt1 = xt*cos( radians(zrot) ) - yt*sin( radians(zrot) ) ;
//edge point
translate <xt1,yt1,zt>
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |