#define make_donut_model /** \file donut.gml * A script to generate a horizontal ring torus model * with normals and a texture * 22 July 2006 */ /** \def make_donut_model(radius,radius2,steps,steps2) * make_donut_model(radius,radius2,steps,steps2) * * radius is the radius of the torus * radius2 is the radius of the cross-section * so that the total outside radius=radius+radius2 * and the radius of the hole=radius-radius2 * steps=the number of segments round the torus (try 20) * steps2=the number of steps through the hole (try 10) * * returns a model ID * * Model is generated as a series of triangle_strips so the vertex * count is almost half that of a triangle_list form * Model has been tweaked so the texture wraps onto the torus in * a similar way to the basic sphere. * */ var donut_ID0,dx,dx2,dy,xs,ys,r,r2,tx,ty,tz,tx2,ty2,tz2,tx3,ty3,tz3,tx4,ty4,tz4; donut_ID0 = d3d_model_create(); r=argument0; r2=argument1; xs=floor(argument2); ys=floor(argument3); for(dx=0;dx