aitzolmuelas' blog

Blog focused in computer graphics mainly. Personal comments and opinions are also welcome.

Monday, August 21, 2006

My first wavy column

I said I would try and finish it before tomorrow and Voila! Here it is, my first parametric surface that actually looks like something. And here are the x, y and z parametric equations for the surface:

#declare Rad = 0.3;
#declare Faces = 4;

#declare Steps = 10;
#declare Base = 2.5;
#declare Base2 = 2.3;
#declare a = exp(ln(1/Base)/(-Steps));
#declare a2 = exp(ln(1/Base2)/(-Steps));
#declare Power = 3;

#declare FxA = function(u,v) {((pow(Base2*pow(a2, u-Steps), Power)+pow(Base*pow(a, -u), Power))*Rad/(2*3)+0.05*cos(Faces*v+6*(sin(pi*u)+1)*sin(6*u)))*cos(v)}
#declare FyA = function(u,v) {u}
#declare FzA = function(u,v) {((pow(Base2*pow(a2, u-Steps), Power)+pow(Base*pow(a, -u), Power))*Rad/(2*3)+0.05*cos(Faces*v+6*(sin(pi*u)+1)*sin(6*u)))*sin(v)}

I know, it could be a lot cleaner, plus it is POV-Ray SDL, so it might be a bit complicated to someone. Will try to be clearer next time ^_^. As a brief help, exp(x) is e to the power of x, and the rest is pretty self-explanatory, if you know a bit of math. Enjoy

0 Comments:

Post a Comment

<< Home