|
![](/i/fill.gif) |
On 28 Apr 2004 09:50:38 -0400, Warp <war### [at] tag povray org> wrote:
> > The main disadvantage of your system to me seems you don't have access
> > to the internal functions of POV-Ray which otherwise are very important
> > for creating scenes.
>
> That's true. For instance being able to call trace() or inside() is
> pretty handy sometimes. I don't see any easy way of doing the same
> with a C++ frontend (at least not without a lot of work).
Something like below (not perfect at all) workaround comes to my mind:
bool Inside(Object& obj,Vector& V)
{
Frame temp_frame("c:\\temp\\temp_file.pov");
temp_frame << "#declare Object =";
temp_frame << obj;
temp_frame << ";\n\n";
temp_frame << "#declare Vector =";
temp_frame << V;
temp_frame << ";\n\n";
temp_frame << "#declare is_inside = inside( Object , Vector );\n\n";
temp_frame << "#fopen MyFile \"c:\\temp\\temp_file.out\" write";
temp_frame << "#write (MyFile,is_inside)";
temp_frame << "#fclose MyFile";
temp_frame.render();
FILE *temp_file = fopen ("c:\\temp\\temp_file.out" , "r");
int is_inside = fgetc(temp_file);
fclose(temp_file);
return is_inside == '1';
}
ABX
Post a reply to this message
|
![](/i/fill.gif) |