 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Tom Bates" <tho### [at] shaw ca> wrote :
>
> Bill DeWitt, you inspired me,
I apologize for that. We all know how painful that can be.
> I used your notation, yxz(y,x,z),
I was almost going to complain that now my macros and your macros have
the same name, but I decided that having the term 'rotate' before the macro
is a good idea for future clarity, so I can scrap my macros.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Bill DeWitt wrote:
>
> "Tom Bates" <tho### [at] shaw ca> wrote :
> >
> > Bill DeWitt, you inspired me,
>
> I apologize for that. We all know how painful that can be.
Yes. The looks my wife gave me when I finally went to bed
(at 2:30am) are all entirely your fault. ;)
(I didn't tell her that, though. I told her I was working.)
>
> > I used your notation, yxz(y,x,z),
>
> I was almost going to complain that now my macros and your macros have
> the same name, but I decided that having the term 'rotate' before the
macro
> is a good idea for future clarity, so I can scrap my macros.
I do apologize. I didn't mean to step on your toes with this.
I just thought that ...
Well, I don't know, I guess I didn't think about it much at all.
Again I apologize.
Anyone can change the names of the macros that I posted
if they conflict with anything they're doing, but for me I used
your notation because it just worked best for me.
Tom Bates.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Tom,
It's not your fault. No one ever gets Bill's jokes.
--
Ken Tyler
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Ken" <tyl### [at] pacbell net> wrote in message
news:3C013EA9.B84A4041@pacbell.net...
>
> Tom,
>
> It's not your fault. No one ever gets Bill's jokes.
That's yet another true thing that has somehow, unaccountably (perhaps a
freak electron spike caused by a chance convergence of cosmic rays), been
said by Ken...
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Bill DeWitt wrote:
>
> "Ken" <tyl### [at] pacbell net> wrote in message
> news:3C013EA9.B84A4041@pacbell.net...
> >
> > Tom,
> >
> > It's not your fault. No one ever gets Bill's jokes.
>
> That's yet another true thing that has somehow, unaccountably (perhaps a
> freak electron spike caused by a chance convergence of cosmic rays), been
> said by Ken...
Someone gave me a round toit so now I am more intoitive.
--
Ken Tyler
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|
 |