POV-Ray : Newsgroups : povray.general : Generating SDL : Generating SDL Server Time
5 Aug 2024 18:20:23 EDT (-0400)
  Generating SDL  
From: pto
Date: 15 Aug 2002 07:39:44
Message: <3D5B9300.9050709@cs.helsinki.fi>
I started making library to generate pov SDL with c++. The idea is to 
have API like this:

int main() {
	p_camera();begin();
		p_look_at(); p_vector(2,3,2);
		p_angle(); p_float(135);
	end();

	box(); begin();
		p_float(-1); p_float(9);
		p_pigment(); begin();
			p_rgb(.8);
		end();
		p_finish();begin();
			p_reflection(); p_float(.3);
		end();
	end();
}

which produces POV SDL like this:

camera { look_at <2,3,2> angle 135 } box { -1 9 pigment { rgb 0.8 } 
finish { reflection 0.3 } }

Large parts of this API can be generated directly from list of reserved 
words and only some parts need to be hand coded (vector, color etc.).

With this API one could implements his own routines and take advantage 
from full power of c++. Greatest problem I see is that error messages 
would be difficult to map into code.

void camera(vector a,vector b,float c)
{
	p_camera();p_begin();
		p_location();p_vector(a);
		p_look_at();p_vector(b);		
		p_angle();p_float(c);
	p_end();	
}

Here is what I have allready made
http://www.cs.helsinki.fi/u/ojamies/pov++/

I have just joined these groups so I don't know if someone has allready 
made this kind of system for POV (and I don't have patience to read few 
thousand mail headers). Does anyone have links?

pto
-- 
camera{look_at y+2angle 135} box{-1 9pigment{rgb.8} finish{reflection.3} 
no_image}#macro l(a) light_source{8*a rgb a/vlength(a)fade_power 2 
fade_distance 3}#end l(x)l(y)l(z)l(1-x)l(1-y)l(1-z)l(x+y+z) sphere{4 3 
finish{reflection 1}no_shadow}//pto


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.