POV-Ray : Newsgroups : povray.general : Coordinates baking in pov Server Time
3 Nov 2024 01:10:13 EDT (-0400)
  Coordinates baking in pov (Message 1 to 5 of 5)  
From: H  Karsten
Subject: Coordinates baking in pov
Date: 18 Feb 2008 08:35:01
Message: <web.47b9887c93fc6a8bf8a489ba0@news.povray.org>
Hi people, I have the problem, that I need to have the position and orientation
of an object in povray. But all objects are translated couple of times by using
several values! By using macros like this:

#macro rotation(ctr)
(<
degrees(rot(ctr).y),
degrees(rot(ctr).z),
-degrees(rot(ctr).x)>
)
#end

#macro position(ctr)
(<-pos(ctr).y,-pos(ctr).z,pos(ctr).x>)
#end

#macro fluking(ctr)
(<degrees(flk(ctr).u),flk(ctr).v>)
#end

rot(bla),pos and flk are splines, defined by thousands of entry's!

I need to write a file, with contains the absolute position and rotation of
these objects.

Any ideas?


Post a reply to this message

From: Warp
Subject: Re: Coordinates baking in pov
Date: 18 Feb 2008 08:44:50
Message: <47b98bd2@news.povray.org>
H. Karsten <h-karsten()web.de> wrote:
> I need to write a file, with contains the absolute position and rotation of
> these objects.

  Define a vector (let's call it L for short) which contains the location
of the unmodified object, and another (O) which contains its orientation.

  Each time you translate the object, add the translation vector to L.
Each time you rotate the object, apply the same rotation to both L and O
using vrotate(). Each time you scale the object, multiply L with the
scaling factor (even if it's uneven scaling using a vector as factor).

-- 
                                                          - Warp


Post a reply to this message

From: H  Karsten
Subject: Re: Coordinates baking in pov
Date: 18 Feb 2008 09:10:01
Message: <web.47b990ec6961e077f8a489ba0@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> H. Karsten <h-karsten()web.de> wrote:
> > I need to write a file, with contains the absolute position and rotation of
> > these objects.
>
>   Define a vector (let's call it L for short) which contains the location
> of the unmodified object, and another (O) which contains its orientation.
>
>   Each time you translate the object, add the translation vector to L.
> Each time you rotate the object, apply the same rotation to both L and O
> using vrotate(). Each time you scale the object, multiply L with the
> scaling factor (even if it's uneven scaling using a vector as factor).
>
> --
>                                                           - Warp

A question to vrotate:

When I'm rotate an object, I have to do this in a right order:

 rotate <rrx,0,0>/power
 rotate <0,0,rrz>/power
 rotate <0,rry,0>/power

This is absolute necessary!

Just by adding the values would give me the wrong result. vrotate gives the
right result?

-holger-


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Coordinates baking in pov
Date: 18 Feb 2008 09:37:23
Message: <47b99823$1@news.povray.org>

> Just by adding the values would give me the wrong result. vrotate gives the
> right result?
> 

Do three vrotate calls.

#declare A = vrotate(A, x*rrx/power);
#declare A = vrotate(A, z*rrz/power);
#declare A = vrotate(A, y*rry/power);

In fact, you could do this too:

#declare A = vrotate(A, <rrx, 0, rrz>/power);
#declare A = vrotate(A, < 0, rry, 0 >/power);


Post a reply to this message

From: H  Karsten
Subject: Re: Coordinates baking in pov
Date: 18 Feb 2008 09:55:01
Message: <web.47b99b646961e077f8a489ba0@news.povray.org>
Thanx people! This will help :)

-holger-


Post a reply to this message

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