|
|
"Greg Sanders" <gvi### [at] oraclerenonvus> writes:
> I want to multiply clock value by 100 to get integer value (x) and then
> place object{TargetX}
> Can this be done in POV3?
Maybe, but my idea is, uh... tricky. You could try writing a .inc file (in
your .pov file, with #debug directives or so) containing the name of the object
you want to use, then include this file. Will it work? I do not know, since
the file will not have been closed before you attempt to read it. It might be
worth trying, though.
Roland.
--
bob### [at] casimirrezelenstfr -- Linux, POV-Ray, LaTeX
Post a reply to this message
|
|
|
|
Greg Sanders wrote:
>
> Help! I am trying to combine a string of text with clock to create an
> object name.
>
> For Instance:
>
> clock=0 to 1
> frames=100
>
> I want to use various objects named
> Target1
> Target2
> Target3...Target100
>
> I want to multiply clock value by 100 to get integer value (x) and then
> place object{TargetX}
Ideally, you would use an array of declared objects for this purpose;
unfortunately, you will have to wait for POV 3.1 (or perhaps download a
patch) to enable this. Otherwise, I would suggest using an include
file, containing all your desired objects, wrapped in #switch ... #end
statements, eg:
#switch (int(clock * 100))
#case (0)
object {[... full definition for object 0 ...]}
#break
#case (1)
object {[... full definition for object 1 ...]}
#break
....
#case (100)
object {[... final object definition ...]}
#end
You can then include the file (eg. #include "Target.obj") when you need
the object. You can even use multiple copies by declaring the include
file as an object variable, eg:
#declare TargetObject = #include "Target.obj"
This method has the advantage of only requiring memory for the object
being used in the current frame, rather than all 100 objects. Of
course, you may want to predeclare all 100 objects for some reason or
another (eg. you want to use various Target* objects in a single frame);
in this case, declare all the objects using the desired names (Target1,
Target2, etc.), and change the include file to just read:
#switch (int(clock * 100))
#case (0) object {Target1} #break
#case (1) object {Target2} #break
...
#case (100) object {Target100} #end
Post a reply to this message
|
|