|
|
Wasn't it D. Stimits who wrote:
>I'm very new to POVray, and using version 3.5 on Linux. In general, I'm
>a C and C++ programmer, and am trying to do something in POVray that
>would be a simple procedural call in C.
>
>I'm creating a scene of a set of nodes and paths between nodes for
>creation of a picture something like the "traveling salesman" problem. A
>path is traced through a series of locations (nodes) on given paths
>(edges), finding the minimum path that visits each node exactly once. It
>looks something like a 3D chess board with selected edges being placed
>between squares, and some squares missing.
>
>I want to declare a global variable:
>#declare Node_Center = < 0.0, 0.0, 0.0 >;
>
>And then prior to calling a macro inside of an object {} that renders a
>node icon based on location of Node_Center, I want to call another macro
>(such as "Translate_Left") that alters the value of Node_Center in one
>direction (partially desired because of different handedness of POVray
>axis and the input data axis), taking into account a scale. The problem
>is I cannot seem to find a way to actually alter the content of
>Node_Center that is not an error. I have to alter the value of
>Node_Center before calling:
>
>object {
> Render_Node (Node_Center)
>}
>
>Then the outside application can write the scene file based on something
>like a series of:
>
>Translate_Left ()
>object {
> Render_Node (Node_Center)
>}
>
>Translate_Up ()
>object {
> Render_Node (Node_Center)
>}
>
>The application itself then merely knows to go left, right, up, or down,
>and does not have to keep track of Node_Center, nor does the application
>need to understand the difference in axis handedness or scaling between
>data and POVray. Is it even possible to alter a global declaration like
>this from outside of the object? If I can only do this from inside of an
>object, how can I alter my global value prior to rendering the node's icon?
>
I would have thought that the following syntax would work. What errors
are you getting?
#macro Translate_Left()
#declare Node_Center = Node_Center - x;
#end
#macro Translate_Up()
#declare Node_Center = Node_Center +y;
#end
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
|