Unc opened this issue on Jan 09, 2002 ยท 5 posts
MarkBremmer posted Thu, 10 January 2002 at 10:32 AM
Hi Unc, Yep, it's a formula. (although I think it could be done in the spline modeler as well) I have a formula for it from a PovRay file that I've been slowly translating into Carrara. The two programs use different syntax, and frankly, I'm a little unsure as to script the variables in the last portion of the formula. Here is the original source file (I'm assuming the dx, dy caclulation should actually be applied as a deformer as shown in the prelim calc area. Double values such as vv and uu should be translated as v and u respectively-I think! ;) pi translates as PI): //various constants uumin = 0 uumax = 4pi vvmin = 0 vvmax = 2pi a=1 b=0.3 c=0.5 d=0.3 //preliminary calculations r=a+bcos(1.5uu) xx=rcos(uu) yy=rsin(uu) zz=csin(1.5uu) dx=-1.5bsin(1.5uu)cos(uu)-(a+bcos(1.5uu))sin(uu) dy=-1.5bsin(1.5uu)sin(uu)+(a+bcos(1.5uu))cos(uu) dz=1.5ccos(1.5uu) //Derivatives qn=vnormalize() //Vector operatons qvn=vnormalize() ww=vcross(qn,qvn) //points and normals x1=xx+d(qvn.xcos(vv)+ww.xsin(vv)) //Calculate the y1=yy+d*(qvn.ycos(vv)+ww.ysin(vv)) //points. ww.x is the z1=zz+dww.zsin(vv) //x value of ww vector nx1=qvn.xcos(vv)+ww.xsin(vv) //Normals needed to ny1=qvn.ycos(vv)+ww.ysin(vv) //make smooth triangles nz1=ww.z*sin(vv)