POV-Ray : Newsgroups : povray.general : computed rotate in macros : Re: computed rotate in macros Server Time
12 Aug 2024 09:19:51 EDT (-0400)
  Re: computed rotate in macros  
From: John M  Dlugosz
Date: 1 Mar 1999 01:37:04
Message: <36da3590.0@news.povray.org>
Ken wrote in message <36D99775.CAF9A4D1@pacbell.net>...
>  The alternative is constructing the object at origin, rotating it,
>and then applying the translations you need to make. This will allow you
>to maintain any rotational attribute you have given the object.



That =is= what I'm doing.

You could write a macro like this:
    object {
        MyThing (/* controlling parameters... */  ,  Pos, Orientation)
        // ...

as an alternative to writing
    object {
         MyThing (/* controlling parameters... */)
         rotate Orientation
        translate Pos
        // ...

with the advantage that the macro =knows= about that information and can
adjust itself accordingly.

However, I would find it more convenient to specify the "Orientation"
information not as the kind of x,y,z angles you normally give to "rotate",
but as a vector that points in the object's "Forward" direction.  This is
much more useful for computing object details within the macro, and I want
to develop a general technique based on it.

So, how do I turn the Forward vector into something that the "rotate"
command likes?

--John


Post a reply to this message

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