|
|
> I would like to have syntax like:
>
> object {
> MyObject
> forget_previous_materials
> material { pigment { rgb 1 } }
> }
>
> or
>
> object {
> MyObject
> force_material { pigment { rgb 1 } }
> }
> I think that keyword should result in function walking entire tree of
> given object (all it-s subojbects, down to all primitives, and replace
> pointers to materials in all of them to point to a new texture).
It would be quite easy. You would just have to add a bit to the parser
to recognise that token and free the texture/material (recursively down
an object's siblings and children if necessary), and then let the new
material be parsed as normal.
> Where should I start? Is there some tutorial for povray programming?
You should start in parse.cpp and tokenize.cpp, and their associated
header files. There is (to my knowledge) no tutorial in POV-Ray
programming, for a good reason. The code is very nasty and hacky
(especially the parser) and should not be touched by anyone who wants to
escape with his sanity intact. Possibly when Hell freezes over and
POV-Ray 4 is released, the code will be so nice and modular that you
won't even need a tutorial!
Daniel
Post a reply to this message
|
|