POV-Ray : Newsgroups : povray.pov4.discussion.general : A dream about POV4 Server Time
28 Mar 2024 20:33:02 EDT (-0400)
  A dream about POV4 (Message 11 to 15 of 15)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Warp
Subject: Re: A dream about POV4
Date: 14 Apr 2009 12:54:08
Message: <49e4bfaf@news.povray.org>
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

From: clipka
Subject: Re: A dream about POV4
Date: 14 Apr 2009 13:10:01
Message: <web.49e4c280840aad1af06ce2830@news.povray.org>
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

From: Bill Pragnell
Subject: Re: A dream about POV4
Date: 14 Apr 2009 13:30:01
Message: <web.49e4c757840aad1a69f956610@news.povray.org>
"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

From: clipka
Subject: Re: A dream about POV4
Date: 14 Apr 2009 20:25:00
Message: <web.49e52846840aad1af06ce2830@news.povray.org>
"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

From: scott
Subject: Re: A dream about POV4
Date: 16 Apr 2009 05:56:52
Message: <49e700e4@news.povray.org>
> 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

<<< Previous 10 Messages Goto Initial 10 Messages

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