POV-Ray : Newsgroups : povray.general : Rotate list Server Time
7 Aug 2024 09:25:23 EDT (-0400)
  Rotate list (Message 11 to 20 of 25)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 5 Messages >>>
From: Bill DeWitt
Subject: Re: Rotate list
Date: 17 Nov 2001 11:37:28
Message: <3bf69248$1@news.povray.org>
"Bill DeWitt" <bde### [at] cflrrcom> wrote :
>
>     New thought. Six macros xyz(,,), xzy(,,), yxz(,,), yzx(,,), zxy(,,),
and
> zyx(,,) (the first one is included for consistency)

    Eh... maybe if I got used to them, right now they just seem
counter-intuitive. I keep wanting to type the degrees in as xyz, and I tried
making the macros that way (zxy(x,y,z)), but then it seemed even wronger. So
I made them zxy(z,x,y) and that keeps me remembering that I am re-ordering
the rotations... but I keep accidentally typing them xyz.

    Probably a personal problem...


Post a reply to this message

From: Ken
Subject: Re: Rotate list
Date: 17 Nov 2001 11:42:20
Message: <3BF693B2.DC7CE1D@pacbell.net>
Bill DeWitt wrote:
> 
> "Bill DeWitt" <bde### [at] cflrrcom> wrote :
> >
> >     New thought. Six macros xyz(,,), xzy(,,), yxz(,,), yzx(,,), zxy(,,),
> and
> > zyx(,,) (the first one is included for consistency)
> 
>     Eh... maybe if I got used to them, right now they just seem
> counter-intuitive. I keep wanting to type the degrees in as xyz, and I tried
> making the macros that way (zxy(x,y,z)), but then it seemed even wronger. So
> I made them zxy(z,x,y) and that keeps me remembering that I am re-ordering
> the rotations... but I keep accidentally typing them xyz.
> 
>     Probably a personal problem...

Perhaps you are merely over complicating things.

-- 
Ken Tyler


Post a reply to this message

From: Bill DeWitt
Subject: Re: Rotate list
Date: 17 Nov 2001 13:31:20
Message: <3bf6acf8$1@news.povray.org>
"Ken" <tyl### [at] pacbellnet> wrote :
>
> Perhaps you are merely over complicating things.

    Merely over-complicating... is that an oxymoron?

    One of the best things about POV-Ray, as I am sure you know, is that by
being very complicated once, you can make things very easy more often. I
think, after using it most of the morning, that using (for instance)
zxy(z,x,y) is going to be easier once I get used to it. the thing to do is
to use xyz(x,y,z) too, so I don't lose the new habit.


Post a reply to this message

From: nospam
Subject: Re: Rotate list
Date: 17 Nov 2001 14:09:16
Message: <3bf6b363.4819448@localhost>
On Tue, 13 Nov 2001 12:49:02 -0500, "Bill DeWitt"
<bde### [at] cflrrcom> wrote:

>There is probably a simple way to do this, but I end up doing it the hard
>way and I am getting tired of it...
>
>    What I want to do is say "rotate y*30, x*60, z*90"
>
>    Instead I write
>    rotate y*30
>    rotate <60,0,90>
>
>    I made a sloppy macro that does it but it takes just about as much
>typing to #include it and then do rotmac( y,30,x,60,z,90)
>
>    Surely there is a better way. Am I missing something obvious?
>
>


I'm not sure if I understand the problem but I will post anyway and
hope it helps.  Here is a macro which takes three vectors and
rotates them in the order they are given:


  #macro rot_3(v1, v2, v3)
    rotate v1
    rotate v2
    rotate v3
  #end


To see the usefulness of that macro, let us show a sample call of
the macro, using your sample rotations:

  rot_3(y*30, x*60, z*90)


This saves a little typing.  Is that what you were thinking of?


Pete


Post a reply to this message

From: Bill DeWitt
Subject: Re: Rotate list
Date: 17 Nov 2001 16:39:55
Message: <3bf6d92b@news.povray.org>
"nospam" <Pet### [at] nymaliasnetalmost> wrote :
>
>   rot_3(y*30, x*60, z*90)

    It's handy, and I went through it on my way to the more simple
xzy(x,z,y) type formula. I liked it in that it mad it very clear what you
were doing when you typed in the values, but still didn't like having to
type x*30 instead of just 30


Post a reply to this message

From: nospam
Subject: Re: Rotate list
Date: 22 Nov 2001 13:47:29
Message: <3bfd2fd7.1712143@localhost>
On Sat, 17 Nov 2001 16:39:58 -0500, "Bill DeWitt"
<bde### [at] cflrrcom> wrote:

>
>"nospam" <Pet### [at] nymaliasnetalmost> wrote :
>>
>>   rot_3(y*30, x*60, z*90)
>
>    It's handy, and I went through it on my way to the more simple
>xzy(x,z,y) type formula. I liked it in that it mad it very clear what you
>were doing when you typed in the values,

	Thank you!   Being clear is so important, yet so difficult to
do.  I'm reminded of this every time I try to puzzle out some elses
source code.  :)

> but still didn't like having to
>type x*30 instead of just 30
>

	Hey: can't argue with that.  :)  I'm glad you came up with
a solution.


Post a reply to this message

From: Tom Bates
Subject: Re: Rotate list
Date: 24 Nov 2001 02:50:17
Message: <3bff5139@news.povray.org>
Bill DeWitt <bde### [at] cflrrcom> wrote in message
news:3bf6acf8$1@news.povray.org...
>
> "Ken" <tyl### [at] pacbellnet> wrote :
> >
> > Perhaps you are merely over complicating things.
>
>     Merely over-complicating... is that an oxymoron?
>
>     One of the best things about POV-Ray, as I am sure you know, is that
by
> being very complicated once, you can make things very easy more often. I
> think, after using it most of the morning, that using (for instance)
> zxy(z,x,y) is going to be easier once I get used to it. the thing to do is
> to use xyz(x,y,z) too, so I don't lose the new habit.
>
>

Bill, what kind of macros are these?

Do they actually do the rotations, like this:

#macro zxy(pz,px,py)
  rotate pz*z
  rotate px*x
  rotate py*y
#end

object { MyObject
  zxy(30,45,-60)
}

Or, do they create a vector that can be used for the correct rotation, like
this:

#macro zxy(pz,px,py)
  #local rx = ????;
  #local ry = ????;
  #local rz = ????;
  // I don't know what goes here, I'm working on it.
  <rx,ry,rz>
#end

object { MyObject
  rotate zxy(30,45,-60)
}

Obviously, the first one is easier to do, but the second one is what I'm
trying to figure out.

Do you have some help for me?

Tom Bates


Post a reply to this message

From: Bill DeWitt
Subject: Re: Rotate list
Date: 24 Nov 2001 08:00:00
Message: <3bff99d0$1@news.povray.org>
"Tom Bates" <tho### [at] shawca> wrote :
>
> Bill, what kind of macros are these?
>
> Do they actually do the rotations, like this:
>
> #macro zxy(pz,px,py)
>   rotate pz*z
>   rotate px*x
>   rotate py*y
> #end
>
> object { MyObject
>   zxy(30,45,-60)
> }

    Yes, almost exactly this. But I do it

#macro zxy(ZEE, EKS, WHY)
   rotate z*ZEE
   rotate< EKS, WHY, 0>
#end

    ...which has the same effect.

> Or, do they create a vector that can be used for the correct rotation,
like
> this:
>
> #macro zxy(pz,px,py)
>   #local rx = ????;
>   #local ry = ????;
>   #local rz = ????;
>   // I don't know what goes here, I'm working on it.
>   <rx,ry,rz>
> #end
>
> object { MyObject
>   rotate zxy(30,45,-60)
> }
>
> Obviously, the first one is easier to do, but the second one is what I'm
> trying to figure out.
>
> Do you have some help for me?

    Er... no... not off the top of my head, but I can see some benefit to
that though. You can predefine rotations and then change them.

#if (INT < VAR)
#declare ROT = <30, 40, 50>;
#else
#declare ROT = zxy(30, 60, 90)
#end

object { OBJ rotate ROT }

    I'll think about it and get back to you.


Post a reply to this message

From: Tom Bates
Subject: Re: Rotate list
Date: 24 Nov 2001 12:23:02
Message: <3bffd776@news.povray.org>
Bill DeWitt <bde### [at] cflrrcom> wrote in message
news:3bff99d0$1@news.povray.org...
>
> "Tom Bates" <tho### [at] shawca> wrote :
> >
> > Bill, what kind of macros are these?
> >
> > Do they actually do the rotations, like this:
> >
> > #macro zxy(pz,px,py)
> >   rotate pz*z
> >   rotate px*x
> >   rotate py*y
> > #end
> >
> > object { MyObject
> >   zxy(30,45,-60)
> > }
>
>     Yes, almost exactly this. But I do it
>
> #macro zxy(ZEE, EKS, WHY)
>    rotate z*ZEE
>    rotate< EKS, WHY, 0>
> #end
>
>     ...which has the same effect.
>
> > Or, do they create a vector that can be used for the correct rotation,
> like
> > this:
> >
> > #macro zxy(pz,px,py)
> >   #local rx = ????;
> >   #local ry = ????;
> >   #local rz = ????;
> >   // I don't know what goes here, I'm working on it.
> >   <rx,ry,rz>
> > #end
> >
> > object { MyObject
> >   rotate zxy(30,45,-60)
> > }
> >
> > Obviously, the first one is easier to do, but the second one is what I'm
> > trying to figure out.
> >
> > Do you have some help for me?
>
>     Er... no... not off the top of my head, but I can see some benefit to
> that though. You can predefine rotations and then change them.
>
> #if (INT < VAR)
> #declare ROT = <30, 40, 50>;
> #else
> #declare ROT = zxy(30, 60, 90)
> #end
>
> object { OBJ rotate ROT }
>
>     I'll think about it and get back to you.
>
>

The reason I ask is that I'm developing a macro model of a creature that
takes two include files as parameters, one for genetics parameters (which
defines the size and shape of the creature), and one for position parameters
(which defines the position and expression for the creature).

It is used like this:

#include "Creature.pov"

object { Creature("Human1.inc", "Human_Walking.inc" )
  rotate <0,-120,0>
  translate <0.30,1.93,14.00>*m
}


And the position file is like this:

  // ...
  #declare RAHR   = <   0, -90,   0>;   //  Right Arm Hand Rotation
  #declare RAER   = <   0,   0, 120>;   //  Right Arm Elbow Rotation
  #declare RASR   = < -90, -45,   0>;   //  Right Arm Shoulder Rotation
  // ...

When I was trying to close a thumb around a closed fist, the rotations I
wanted for the base of the thumb were: 90*y, 30*z, 45*x.  I played with
matrices in MS-Excel for a couple of hours (some linear math, some trig,
some geometry, some trial and error) to come up with <60,45,90> that did the
same rotation.

instead of this,

  #declare RHF1A1 = <  60,  45,  90>;   //  Right Hand Finger 1 Angle 1

I would have loved to be able to do this (using your notation, which I think
is next to perfect, btw):

  #declare RHF1A1 = yzx(  90,  30,  45);   //  Right Hand Finger 1 Angle 1


Would anyone be able/willing to help me with the math for the general
rotation conversion macros that I need?

Thanks,

Tom Bates.


Post a reply to this message

From: Tom Bates
Subject: Re: Rotate list
Date: 25 Nov 2001 04:25:29
Message: <3c00b909$1@news.povray.org>
Bill DeWitt wrote:
>
> "Tom Bates" <tho### [at] shawca> wrote :
> >
> > Bill, what kind of macros are these?
> >
> > Do they actually do the rotations, like this:
> >
> > #macro zxy(pz,px,py)
> >   rotate pz*z
> >   rotate px*x
> >   rotate py*y
> > #end
> >
> > object { MyObject
> >   zxy(30,45,-60)
> > }
>
>     Yes, almost exactly this. But I do it
>
> #macro zxy(ZEE, EKS, WHY)
>    rotate z*ZEE
>    rotate< EKS, WHY, 0>
> #end
>
>     ...which has the same effect.
>
> > Or, do they create a vector that can be used for the correct rotation,
> like
> > this:
> >
> > #macro zxy(pz,px,py)
> >   #local rx = ????;
> >   #local ry = ????;
> >   #local rz = ????;
> >   // I don't know what goes here, I'm working on it.
> >   <rx,ry,rz>
> > #end
> >
> > object { MyObject
> >   rotate zxy(30,45,-60)
> > }
> >
> > Obviously, the first one is easier to do, but the second one is what I'm
> > trying to figure out.
> >
> > Do you have some help for me?
>
>     Er... no... not off the top of my head, but I can see some benefit to
> that though. You can predefine rotations and then change them.
>
> #if (INT < VAR)
> #declare ROT = <30, 40, 50>;
> #else
> #declare ROT = zxy(30, 60, 90)
> #end
>
> object { OBJ rotate ROT }
>
>     I'll think about it and get back to you.
>

Bill DeWitt, you inspired me, and I did it.

I spent several more hours with Excel and paper and pencil (but
with more trig this time and less trial and error) and came up with
a nice, elegant solution.  I've posted "RotateList.inc" in p.b.s-f.

I used your notation, yxz(y,x,z), but in this case it will return a
single rotation vector that will result in the same rotation as if
you had used <0,y,0> then <x,0,z>.

It's used as a vector and can be assigned to a variable to be
used for a rotation later in the script.

Tom Bates.


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 5 Messages >>>

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