 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Bill DeWitt" <bde### [at] cfl rr com> 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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Bill DeWitt wrote:
>
> "Bill DeWitt" <bde### [at] cfl rr com> 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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Ken" <tyl### [at] pacbell net> 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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Tue, 13 Nov 2001 12:49:02 -0500, "Bill DeWitt"
<bde### [at] cfl rr com> 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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"nospam" <Pet### [at] nym alias net almost> 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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Sat, 17 Nov 2001 16:39:58 -0500, "Bill DeWitt"
<bde### [at] cfl rr com> wrote:
>
>"nospam" <Pet### [at] nym alias net almost> 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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Bill DeWitt <bde### [at] cfl rr com> wrote in message
news:3bf6acf8$1@news.povray.org...
>
> "Ken" <tyl### [at] pacbell net> 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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Tom Bates" <tho### [at] shaw ca> 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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Bill DeWitt <bde### [at] cfl rr com> wrote in message
news:3bff99d0$1@news.povray.org...
>
> "Tom Bates" <tho### [at] shaw ca> 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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Bill DeWitt wrote:
>
> "Tom Bates" <tho### [at] shaw ca> 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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|
 |