|
|
Wasn't it Rafal 'Raf256' Maj who wrote:
>I have a problem when I'm doing more advanced vectors math (in animation
>for example) and some points I'm calculating "by hand" using vrotate etc,
>other are calculated by CSG and transformations. THe problem is when I need
>to convert between both methods.
>Example:
>
>union {
> union {
> object { MY_OBJECT } // object has center in <0,0,0>
> rotate x*90
> translate y*clock
> // where will be center of MY_OBJECT in here - in this context?
> }
> rotate z*sin(clock) translate z*clock*2
> // where will be center of MY_OBJECT in here - in this context?
>}
>
>sphere { position_of_MY_OBJECT_in_this_context 1 }
>
>and I want last sphere to point to center of MY_OBJECT, with is not easy as
>it is in other transformations context and I would heve to repeat all CSG
>transforamtions manualy to calcaulate that point, with is not very
>comfortable.
You don't have to repeat the transforms, you just have to declare them
separately from the objects that you want to transform, like this:
#declare MOVEMENT = transform {
rotate x*90
translate y*clock
rotate z*sin(clock)
translate z*clock*2
}
union {
union {
object { MY_OBJECT } // The main object moved
transform {MOVEMENT}
}
}
sphere {0,1 transform {MOVEMENT}} // A sphere moved the same way
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
|