POV-Ray : Newsgroups : povray.general : vrotate? : Re: vrotate? Server Time
30 Jul 2024 16:24:56 EDT (-0400)
  Re: vrotate?  
From: Kenneth
Date: 9 Mar 2009 02:35:00
Message: <web.49b4b745ed80e874f50167bc0@news.povray.org>
"clipka" <nomail@nomail> wrote:

> As a matter of fact, "rolling" some object is not so trivial as it may seem at
> first, as the only rotational operations POV provides (including the macros in
> "translations.h") are rotations about the main axes.
>
> So here's how to do it:
>
> - Calculate a transformation M that will get your object from its current
> orientation to one that will align its axis of rotation to, say, z...

Hmm, I feel those synapses firing...

> To get the transformation M, you need to first rotate the object about the y
> axis to re-orient the intended axis of rotation to somewhere in the yz plane,
> then rotate the object about the x axis to re-orient it to the z axis.

I think I see smoke coming out of my ears...
>
> Now that you know where your axis will end up after rotating about y, you can
> find out how to re-orient it to match the z axis:
>

My hair's on fire!  :-p

In all seriousness, thanks tremendously much for the code, and for taking the
time to explain it.  I need to digest all this, and to re-think how I was
'looking' at the problem. What you've given me is certainly 100% more (at
least!) than what I knew before.
>
> - VDot and VCross are your friends. Get to know them, and find out how to make
> best use of them.

Yes, I need more POV-code-snippet friends.  As the saying goes, "You can't have
too many friends!" But sometimes they're hard to get to know...

> - Quite a lot of tasks are a good deal easier if you consider a 2D projection
> of the thing first, then deal with the third dimension separately.
>

That's good advice, and I'll keep it in mind.  OK, time for another marathon
thinking session!

KW


Post a reply to this message

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