|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Warp" <war### [at] tagpovrayorg> wrote in message
news:49e396b5@news.povray.org...
> clipka <nomail@nomail> wrote:
>> As a side note, I think a "rotate" statement in a new POV SDL should
>> *not*
>> follow that nasty "rotate about x then about y then about z" approach,
>> but
>> instead allow for rotations about arbitrary axes.
>
> 1) Having to always specify the axis of rotation can be tedious.
I disagree, I almost always specify the axis (rotate y*45 for instance) and
intuitively I would expect something like "rotate <1,1,0>*45" to rotate 45
degrees around the <1,1,0> vector, not 45 degrees around the x-vector
followed by a 45 degrees rotation around the y-axis
cu!
--
#macro G(b,e)b+(e-b)*C/50#end#macro _(b,e,k,l)#local C=0;#while(C<50)
sphere{G(b,e)+3*z.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1;
#end#end _(y-x,y,x,x+y)_(y,-x-y,x+y,y)_(-x-y,-y,y,y+z)_(-y,y,y+z,x+y)
_(0x+y.5+y/2x)_(0x-y.5+y/2x) // ZK http://www.povplace.com
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Zeger Knaepen" <zeg### [at] povplacecom> wrote:
> I disagree, I almost always specify the axis (rotate y*45 for instance) and
> intuitively I would expect something like "rotate <1,1,0>*45" to rotate 45
> degrees around the <1,1,0> vector, not 45 degrees around the x-vector
> followed by a 45 degrees rotation around the y-axis
Hm... the notation "rotate <1,1,0>*45" does seem intuitive, but I guess we'd
need four parameters. Otherwise you'd be surprised why the result would be a
rotation by 63 degrees instead ;)
A nice thing though would be some quick syntax for specifying a normalized
vector, which would work with that syntax; maybe something like:
rotate <<1,1,0>> * 45 deg
BTW, I'd really like that "deg" keyword to specify angles. Or, preferably, even
the "degree" sign, as in:
but unfortunately it's not ASCII, and therefore a portability issue.
Maybe an extension to numerical literals could do the trick to get something
visually similar:
rotate <<1,1,0>> * 45o
Really cool would be something like:
rotate <<1,1,0>> * 45o20'10.37".
But that would cause issues with some editors doing some rudimentary syntax
highlighting...
.... oh well...
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"clipka" <nomail@nomail> wrote in message
news:web.49e3c66a840aad1a2dae03a10@news.povray.org...
> "Zeger Knaepen" <zeg### [at] povplacecom> wrote:
>> I disagree, I almost always specify the axis (rotate y*45 for instance)
>> and
>> intuitively I would expect something like "rotate <1,1,0>*45" to rotate
>> 45
>> degrees around the <1,1,0> vector, not 45 degrees around the x-vector
>> followed by a 45 degrees rotation around the y-axis
>
> Hm... the notation "rotate <1,1,0>*45" does seem intuitive, but I guess
> we'd
> need four parameters. Otherwise you'd be surprised why the result would be
> a
> rotation by 63 degrees instead ;)
the vector is just a direction, and, as in trace, the length shouldn't
matter
cu!
--
#macro G(b,e)b+(e-b)*C/50#end#macro _(b,e,k,l)#local C=0;#while(C<50)
sphere{G(b,e)+3*z.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1;
#end#end _(y-x,y,x,x+y)_(y,-x-y,x+y,y)_(-x-y,-y,y,y+z)_(-y,y,y+z,x+y)
_(0x+y.5+y/2x)_(0x-y.5+y/2x) // ZK http://www.povplace.com
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
ok, I take that back, otherwise "rotate <0,45,0>" wouldn't work anymore
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Zeger Knaepen" <zeg### [at] povplacecom> wrote:
> > Hm... the notation "rotate <1,1,0>*45" does seem intuitive, but I guess
> > we'd
> > need four parameters. Otherwise you'd be surprised why the result would be
> > a
> > rotation by 63 degrees instead ;)
>
> the vector is just a direction, and, as in trace, the length shouldn't
> matter
But by how many degrees do you want to rotate?
If you go for analogy with y*45, the angle to rotate by would be encoded in the
vector's length.
The expression <1,1,0>*45, however, evaluates to a vector that is ~63 POV units
long...
So yes, size *does* matter :)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Zeger Knaepen <zeg### [at] povplacecom> wrote:
> intuitively I would expect something like "rotate <1,1,0>*45" to rotate 45
> degrees around the <1,1,0> vector
What if you want to do is to multiply <1,1,0> by 45 and then use the
resulting vector to rotate the object?
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Warp <war### [at] tagpovrayorg> wrote:
> Zeger Knaepen <zeg### [at] povplacecom> wrote:
> > intuitively I would expect something like "rotate <1,1,0>*45" to rotate 45
> > degrees around the <1,1,0> vector
>
> What if you want to do is to multiply <1,1,0> by 45 and then use the
> resulting vector to rotate the object?
Then you'd be back to the 3.x syntax, which is just plain incompatible with what
I'd prefer. It's all that easy.
(and no, I wouldn't use "rotate <1,1,0>*45" - rather some "rotate <1,1,0>,45",
which IMO would make it clear what's happening; I think I'd also use "rotate
<1,1,0>,45 deg".)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"clipka" <nomail@nomail> wrote:
> Warp <war### [at] tagpovrayorg> wrote:
> > Zeger Knaepen <zeg### [at] povplacecom> wrote:
> > > intuitively I would expect something like "rotate <1,1,0>*45" to rotate 45
> > > degrees around the <1,1,0> vector
> >
> > What if you want to do is to multiply <1,1,0> by 45 and then use the
> > resulting vector to rotate the object?
>
> Then you'd be back to the 3.x syntax, which is just plain incompatible with what
> I'd prefer. It's all that easy.
Maybe, but I think multiplying the vector by the scalar is by far the most
intuitive meaning to that example. The language would be very inconsistent
otherwise (unless the intention was to ditch the asterisk as a multiplication
token...!).
> (and no, I wouldn't use "rotate <1,1,0>*45" - rather some "rotate <1,1,0>,45",
> which IMO would make it clear what's happening; I think I'd also use "rotate
> <1,1,0>,45 deg".)
....while permitting, e.g., "rotate 30*<1,1,0>,45" or similar? I would hope that
the new SDL would retain the way literals are handled (or close to it), however
the object structure ends up.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Bill Pragnell" <bil### [at] hotmailcom> wrote:
> > (and no, I wouldn't use "rotate <1,1,0>*45" - rather some "rotate <1,1,0>,45",
> > which IMO would make it clear what's happening; I think I'd also use "rotate
> > <1,1,0>,45 deg".)
>
> ....while permitting, e.g., "rotate 30*<1,1,0>,45" or similar? I would hope that
> the new SDL would retain the way literals are handled (or close to it), however
> the object structure ends up.
Sure, "rotate 30*<1,1,0>,45" or even "rotate <1,1,0>*30,45" would be fair values
(though it doesn't actually make sense to scale a vector when you just want to
rotate around it...)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> Sure, "rotate 30*<1,1,0>,45" or even "rotate <1,1,0>*30,45" would be fair
> values
> (though it doesn't actually make sense to scale a vector when you just
> want to
> rotate around it...)
The rotate keyword is just wrong anyway, it is not obvious what the result
will be (does it do x first or z first?). You also can get the "gimbal
lock" problem with specifying rotations this way.
A new rotate keyword could either take a single vector (for 3.x
compatibility), or take a vector and a scalar (to rotate a certain amount
around that axis). Then all of the following would be valid:
rotate y*45
rotate <0,45,0>
rotate <1,1,0> * 45
rotate <1,1,0> , 45 // new syntax, rotate 45 degrees about the axis
rotate y,45 // new syntax, rotate 45 degrees about the axis
Anyway, I assume in POV4 "rotate" will just be a macro that generates a 4x4
transformation matrix, it should be easy to update/modify later without
recompiling the source. You could even add a rotate macro that takes a
quaternion as a 4-element vector.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|