|
|
Severi Salminen <sev### [at] NOTTHISsaunalahtifiinvalid> wrote:
> Hardcoded at the present. At some point I have to implement a parser but
> that is not a fun thing to do and developing a good SDL takes time...
I've always thought it would be neat to leave it as an API. POV-Ray's SDL is
already similar to C, but you'd also get the benefits of being able to use
numerical libraries, object-oriented programming, and of course, there's SPEED.
All without actually having to write or maintain a parser! The renderer would
just be a static or dynamic library. Of course you have to compile and link
over and over, but how bad is that, really?
#include <ssray.h>
int main( int argc, char** argv ) {
Scene s (argc, argv);
vec x (0.0, 0.0, 0.0);
vec dx (1.0, 0.0, 0.0);
Union u;
for( int i=0; i<100; i++) {
u.push(
sphere( x, 1.0,
pigment( Red )
)
);
x += dx;
)
s.push(u);
s.Render();
return 0;
}
Upon reflection, maybe the answer is, "Pretty bad." I think it's still the
approach I'd take since I don't actually know how to write a proper parser.
- Ricky
Post a reply to this message
|
|