POV-Ray : Newsgroups : povray.general : Rotate list Server Time
15 Oct 2026 10:46:21 EDT (-0400)
  Rotate list (Message 1 to 25 of 25)  
From: Bill DeWitt
Subject: Rotate list
Date: 13 Nov 2001 12:49:02
Message: <3bf15d0e@news.povray.org>
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?


Post a reply to this message

From: ingo
Subject: Re: Rotate list
Date: 13 Nov 2001 14:24:37
Message: <Xns9158CF9FAA0DFseed7@povray.org>
in news:3bf15d0e@news.povray.org Bill DeWitt wrote:

>     Surely there is a better way.

Maybe a matrix? But don't ask me how.

As for #include ..., for small macros like this I prefer to paste them 
from the insert menu and don't put them in an include file.

Ingo

-- 
Photography: http://members.home.nl/ingoogni/
Pov-Ray    : http://members.home.nl/seed7/


Post a reply to this message

From: Bill DeWitt
Subject: Re: Rotate list
Date: 13 Nov 2001 15:40:25
Message: <3bf18539$1@news.povray.org>
"ingo" <ing### [at] homenl> wrote in message
news:Xns### [at] povrayorg...
> in news:3bf15d0e@news.povray.org Bill DeWitt wrote:
>
> >     Surely there is a better way.
>
> Maybe a matrix? But don't ask me how.

    Ouch. My head already hurts just from reading that word. But you are
probably right.

> As for #include ..., for small macros like this I prefer to paste them
> from the insert menu and don't put them in an include file.

    Sometimes I do that, but then I made a .inc with several of my most
commonly used.


Post a reply to this message

From: Josh English
Subject: Re: Rotate list
Date: 13 Nov 2001 16:30:41
Message: <3BF190D5.B6524466@spiritone.com>
> 
>     Surely there is a better way. Am I missing something obvious?

I can't imagine a faster way to type it. As for the parsing of the
scene, I don't know if it's faster for the scene to creates the matrices
and multiply them or let POV-Ray do it automatically.
Plus, your method allows you to line up rotations around any axis if you
use vaxis_rotate.

The problem you have is that your macro requires all six parameters, and
if you only want two rotations you still need to have z,0 as the third
pair of paramters. Optional parameters is on my wish list for POV-Ray 4.

Josh English
eng### [at] spiritonecom


Post a reply to this message

From: Rob Brown-Bayliss
Subject: Re: Rotate list
Date: 15 Nov 2001 02:54:35
Message: <3bf374bb@news.povray.org>
In article <3BF190D5.B6524466@spiritone.com>, "Josh English"
<eng### [at] spiritonecom> wrote:

> Optional parameters is on my wish list for POV-Ray 4.

I am a pov newbie, and opotionl paramaters was one of the first things I
asked about.  It would make life so much more livable :o)


-- 

  Rob Brown-Bayliss
 ---======o======---


Post a reply to this message

From: John VanSickle
Subject: Re: Rotate list
Date: 15 Nov 2001 15:54:53
Message: <3BF42C21.48C7724@hotmail.com>
Bill DeWitt 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?

No.

-- 
ICQ: 46085459


Post a reply to this message

From: Bill DeWitt
Subject: Re: Rotate list
Date: 15 Nov 2001 22:48:29
Message: <3bf48c8d$1@news.povray.org>
"John VanSickle" <evi### [at] hotmailcom> wrote :
> >
> >     Surely there is a better way. Am I missing something obvious?
>
> No.

    I would prefer a different answer if you don't mind.


Post a reply to this message

From: Warp
Subject: Re: Rotate list
Date: 16 Nov 2001 06:19:54
Message: <3bf4f65a@news.povray.org>
Bill DeWitt <bde### [at] cflrrcom> wrote:
:> >     Surely there is a better way. Am I missing something obvious?
:>
:> No.

:     I would prefer a different answer if you don't mind.

  If there isn't any other answer, what can we do about it?

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: John VanSickle
Subject: Re: Rotate list
Date: 17 Nov 2001 02:54:47
Message: <3BF6184F.2328BAD6@hotmail.com>
Bill DeWitt wrote:
> 
> "John VanSickle" <evi### [at] hotmailcom> wrote :
> > >
> > >     Surely there is a better way. Am I missing something obvious?
> >
> > No.
> 
>     I would prefer a different answer if you don't mind.

But "yes" would have been wrong.

Seriously, rotating around x, then y, and then z is an arbitrary
ordering, but is convenient enough for most projects, and the
modelling language was written to reflect that.  Your project is
different (mine often are, too), so you have to do things slightly
differently.

-- 
ICQ: 46085459


Post a reply to this message

From: Bill DeWitt
Subject: Re: Rotate list
Date: 17 Nov 2001 08:10:05
Message: <3bf661ad$1@news.povray.org>
"John VanSickle" <evi### [at] hotmailcom> wrote in message
news:3BF6184F.2328BAD6@hotmail.com...
> Bill DeWitt wrote:
> >
> > "John VanSickle" <evi### [at] hotmailcom> wrote :
> > > >
> > > >     Surely there is a better way. Am I missing something obvious?
> > >
> > > No.
> >
> >     I would prefer a different answer if you don't mind.
>
> But "yes" would have been wrong.

    New thought. Six macros xyz(,,), xzy(,,), yxz(,,), yzx(,,), zxy(,,), and
zyx(,,) (the first one is included for consistency)

    After I make them, I will post them if they are not obvious to everyone.


Post a reply to this message

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

From: Bill DeWitt
Subject: Re: Rotate list
Date: 25 Nov 2001 08:55:03
Message: <3c00f837$1@news.povray.org>
"Tom Bates" <tho### [at] shawca> 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

From: Tom Bates
Subject: Re: Rotate list
Date: 25 Nov 2001 13:49:56
Message: <3c013d54$1@news.povray.org>
Bill DeWitt wrote:
>
> "Tom Bates" <tho### [at] shawca> 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

From: Ken
Subject: Re: Rotate list
Date: 25 Nov 2001 13:54:02
Message: <3C013EA9.B84A4041@pacbell.net>
Tom,

It's not your fault. No one ever gets Bill's jokes.

-- 
Ken Tyler


Post a reply to this message

From: Bill DeWitt
Subject: Re: Rotate list
Date: 25 Nov 2001 16:55:19
Message: <3c0168c7@news.povray.org>
"Ken" <tyl### [at] pacbellnet> 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

From: Ken
Subject: Re: Rotate list
Date: 25 Nov 2001 17:31:15
Message: <3C017192.F3DBD78B@pacbell.net>
Bill DeWitt wrote:
> 
> "Ken" <tyl### [at] pacbellnet> 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

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