POV-Ray : Newsgroups : povray.general : Rotating rotations Server Time
5 Nov 2024 05:24:55 EST (-0500)
  Rotating rotations (Message 1 to 5 of 5)  
From: neb
Subject: Rotating rotations
Date: 4 Jun 2003 13:00:02
Message: <web.3ede25019f43bda8499ab770@news.povray.org>
Note: I was under the impression that I posted this a few hrs ago, but I see
no evidence of it. If I just neede to wait a bit more or did something
stuid like put it in the wrong forum, I appologise for this duplicate.
Either way, I like to believe it had something to do with my schools
security se4ttings or somthing.


Ok, the real probelm:  You take an object and you rotate it <a,b,c>. Then
you rotate the entire thing by <x,y,z>. I need this to be expressed in a
single rotate, but I know its not <a+x,b+y,c+z>. What is it then?

An answer i stumbled upon just a few minutes ago was to create normalized
vectors representing the new axes. By this I mean that the new x axis is
really the old xsqrt(2) zsqrt(2) axis (arbitrary example), so to rotate
something by <0,-45,0> then <90,0,0> would yield something like... well, it
involves multiples of sqare roots. instead of <x,y,z> it is now
<(xsqrt(2)+zsqrt(2), y, zsqrt(2)-xsqrt(2)> or something to that effect. is
this the right way to go about it? calculate normalized new axis?  How do I
write an algorithm to this for arbitrarily messy <a,b,c> and <x,y,z>?


Post a reply to this message

From: Christopher James Huff
Subject: Re: Rotating rotations
Date: 4 Jun 2003 17:54:37
Message: <cjameshuff-654FD6.16472304062003@netplex.aussie.org>
In article <web.3ede25019f43bda8499ab770@news.povray.org>,
 "neb" <neb### [at] qismorg> wrote:

> Ok, the real probelm:  You take an object and you rotate it <a,b,c>. Then
> you rotate the entire thing by <x,y,z>. I need this to be expressed in a
> single rotate, but I know its not <a+x,b+y,c+z>. What is it then?

Why do you need a single rotation? If you just need a single value to 
pass around, do something like this:

#declare Rotations = transform {rotate <a,b,c> rotate <x,y,z>}

object {MyObject
    transform Rotations
}

If you're after a way to transform vectors, make sure you include 
transforms.inc and use "vtransform(Point, Rotations)".

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: neb
Subject: Re: Rotating rotations
Date: 4 Jun 2003 19:35:01
Message: <web.3ede817cee8e2779fa0d47600@news.povray.org>
>Why do you need a single rotation? If you just need a single value to
>pass around, do something like this:
>
>#declare Rotations = transform {rotate <a,b,c> rotate <x,y,z>}
>
>object {MyObject
>    transform Rotations
>}
>
>If you're after a way to transform vectors, make sure you include
>transforms.inc and use "vtransform(Point, Rotations)".

I still have yet to look through transforms.inc, but Im doing this part in
C++ anyway. I really need a way to turn it iinto a single rotation, as it
is not simply two rotations, but an arbitrarily large number of rotations.
I would simply plan on every turn converting the two into one, then making
nother turn. If this turns out to be too difficult (I already have my self,
my father, and my math teacher working on this) there is still a saving
grace. Every rotation for this project is a multiple of 90 degrees,
simplifying much and allowing for an ugly and non-general solution.

PS: why can I not see my original post?


Post a reply to this message

From: Warp
Subject: Re: Rotating rotations
Date: 4 Jun 2003 19:48:57
Message: <3ede8568@news.povray.org>
neb <neb### [at] qismorg> wrote:
> I really need a way to turn it iinto a single rotation, as it
> is not simply two rotations, but an arbitrarily large number of rotations.

  I still fail to see why you need a single rotation.

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

From: Christopher James Huff
Subject: Re: Rotating rotations
Date: 4 Jun 2003 21:43:42
Message: <cjameshuff-AAC99D.20362804062003@netplex.aussie.org>
In article <web.3ede817cee8e2779fa0d47600@news.povray.org>,
 "neb" <neb### [at] qismorg> wrote:

> I still have yet to look through transforms.inc, but Im doing this part in
> C++ anyway.

It would have helped if you had given some indication of this.


> I really need a way to turn it iinto a single rotation, as it
> is not simply two rotations, but an arbitrarily large number of rotations.

And this method, adapted to use some vector math library, will work for 
an arbitrarily large number of rotations. That's the primary reason POV 
uses matrices for transforms: all you need is one relatively small set 
of numbers to describe any sequence of transformations.


> I would simply plan on every turn converting the two into one, then making
> nother turn. If this turns out to be too difficult (I already have my self,
> my father, and my math teacher working on this) there is still a saving
> grace. Every rotation for this project is a multiple of 90 degrees,
> simplifying much and allowing for an ugly and non-general solution.

The usual method seems to be to convert to quaternions or matrices and 
convert back to Euler angles after combining. However, the odds are high 
that the matrix or quaternion is what you really want. You haven't 
actually said what you have in mind.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

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