Last Updated September 20, 2010
//============================================== //Parametric Eqn. of a Torus //============================================== //R=major radius //r=minor radius //u = parameter around 'Big' circle (0 -> 2PI) //v = parameter around 'Small' circle (0 -> 2PI) vertexX=((R+r*cos(u))*cos(v)); vertexY=(r*sin(u)); vertexZ=((R+r*cos(u))*sin(v)); // compute normal for this vertex //(this formula only works for tori!) normalX=vertexX-(R*cos(v)); normalY=vertexY; normalZ=vertexZ-(R*sin(v));
© Ken Power 1996-2016