prev index next 
Modelling Tips, Working With Primitives 
 POV-Ray Tips, 
 Tricks, and Techniques
Declaring Specific Rotations? 
 
Martin Gentry wants  transformation information: In my toying with PoV I've run into a situation where I would just LOVE to be able to do the following with #declare and #include .. the problem is, it doesn't work.  I would like to know if there is any workaround known that will
allow me to get the same effect.

Here's the situation:  I have a hierarchical buildup for a model with nested includes that looks something like this:

scene.pov
        ...
        #declare FirstRotation = <10, 0, 0>
        #declare SecondRotation = <-10, 2, 0>
        #include "foo.inc"
        ...

foo.inc
        ...
        #declare Rotation = FirstRotation
        #include "bar.inc"
        ...
        #declare Rotation = SecondRotation
        #include "bar.inc"
        ...

bar.inc
        ...
        object {
            SomeObject
            rotate Rotation
        }
        ...

I know that the above doesn't work, but I'd really like to find a way to get the same overall effect with the same relative ease.. seeing as how the point of doing it this way is to make life easy. :)
 

Julius Valkenburg assures us:
It IS possible. You have to use transformation identifiers (paragraph 7.3.3).

In your example, that would be something like:

#declare FirstRotation = transform { rotate <10, 0, 0> }
#declare SecondRotation = transform { rotate <-10, 2, 0> }

object {
            SomeObject
            transform FirstRotation
        }

 

  1