home *** CD-ROM | disk | FTP | other *** search
- /* Macgenerate.c
- *
- * Script file generator for the masses
- */
-
-
- #include "atmosphere.h"
- #include "surface.h"
- #include "texture.h"
- #include "image.h"
- #include "geom.h"
- #include "light.h"
- #include "options.h"
- #include "stats.h"
- #include "viewing.h"
-
- #include "blob.h"
- #include "box.h"
- #include "cone.h"
- #include "csg.h"
- #include "cylinder.h"
- #include "disc.h"
- #include "grid.h"
- #include "hf.h"
- #include "instance.h"
- #include "list.h"
- #include "plane.h"
- #include "poly.h"
- #include "sphere.h"
- #include "torus.h"
- #include "triangle.h"
-
- #include "point.h"
- #include "infinite.h"
- #include "spot.h"
- #include "jittered.h"
- #include "extended.h"
-
- #include "blotch.h"
- #include "bump.h"
- #include "checker.h"
- #include "cloud.h"
- #include "fbm.h"
- #include "fbmbump.h"
- #include "gloss.h"
- #include "imagetext.h"
- #include "marble.h"
- #include "mount.h"
- #include "sky.h"
- #include "stripe.h"
- #include "windy.h"
- #include "wood.h"
-
- #include "fog.h"
- #include "fogdeck.h"
- #include "mist.h"
-
- #include "rotate.h"
- #include "scale.h"
- #include "translate.h"
-
- #include "maccreate.h"
- #include "maceditor.h"
-
- extern Surface *Surfaces ;
- extern Geom *Objects, *World ;
- extern Light *Lights ;
-
- static FILE *script ;
- static char ind = 0 ;
-
- void indent()
- {
- char i ;
- for(i = 0 ; i < ind ; i++)
- fprintf(script,"\t") ;
- }
-
- void GenerateLightInstance(Light *l)
- {
- int type ;
-
- if(!l) return ;
- type = LightType(l) ;
- if(type != -1) {
- indent() ;
- if((l->color.r == l->color.b) && (l->color.r == l->color.g))
- fprintf(script,"light %.4f ",l->color.r) ;
- else
- fprintf(script,"light %.4f %.4f %.4f ",l->color.r,l->color.g,l->color.b) ;
- indent() ;
- switch(type) {
- case L_POINT:
- fprintf(script,"point %.4f %.4f %.4f\n",((Pointlight *)l->light)->pos.x,
- ((Pointlight *)l->light)->pos.y,((Pointlight *)l->light)->pos.z) ;
- break ;
- case L_INFINITE:
- fprintf(script,"directional %.4f %.4f %.4f\n",((Infinite *)l->light)->dir.x,
- ((Infinite *)l->light)->dir.y,((Infinite *)l->light)->dir.z) ;
- break ;
- case L_SPOT:
- {
- Float in, out ;
- in = acos(((Spotlight *)l->light)->radius)*360/TWOPI,
- out = acos(((Spotlight *)l->light)->falloff)*360/TWOPI,
- fprintf(script,"spot %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f\n",
- ((Spotlight *)l->light)->pos.x,
- ((Spotlight *)l->light)->pos.y,
- ((Spotlight *)l->light)->pos.z,
- ((Spotlight *)l->light)->dir.x,
- ((Spotlight *)l->light)->dir.y,
- ((Spotlight *)l->light)->dir.z,
- ((Spotlight *)l->light)->coef,
- in,out) ;
- }
- break ;
- case L_JITTERED:
- break ;
- case L_EXTENDED:
- fprintf(script,"extended %.4f %.4f %.4f %.4f\n",((Extended *)l->light)->radius,
- ((Extended *)l->light)->pos.x,((Extended *)l->light)->pos.y,
- ((Extended *)l->light)->pos.z) ;
- break ;
- }
- }
- }
-
-
- void GenerateSurfaceProperties(Surface *s)
- {
- indent() ;
- fprintf(script,"ambient %.4f %.4f %.4f\n",s->amb.r,s->amb.g,s->amb.b) ;
- indent() ;
- fprintf(script,"diffuse %.4f %.4f %.4f\n",s->diff.r,s->diff.g,s->diff.b) ;
- indent() ;
- fprintf(script,"specular %.4f %.4f %.4f\n",s->spec.r,s->spec.g,s->spec.b) ;
- indent() ;
- fprintf(script,"specpow %.4f\n",s->srexp) ;
- indent() ;
- fprintf(script,"body %.4f %.4f %.4f\n",s->body.r,s->body.g,s->body.b) ;
- indent() ;
- fprintf(script,"extinct %.4f\n",s->statten) ;
- indent() ;
- fprintf(script,"transp %.4f\n",s->transp) ;
- indent() ;
- fprintf(script,"reflect %.4f\n",s->reflect) ;
- indent() ;
- fprintf(script,"index %.4f\n",s->index) ;
- indent() ;
- fprintf(script,"translu %.4f %.4f %.4f %.4f %.4f\n",s->translucency,s->translu.r,s->translu.g,s->translu.b,s->stexp) ;
- indent() ;
- if(s->noshadow) {
- fprintf(script,"noshadow\n") ;
- indent() ;
- }
- }
-
- void GenerateSurface(Surface *s)
- {
- Surface *s2 ;
-
- if(!s) return ;
-
- s2 = Surfaces ;
- while(s2 && (s2 != s)) s2 = s2->next ;
-
- if(s2 == s) {
- fprintf(script,"%s ",s->name) ;
- }
- else {
- fprintf(script,"\n") ;
- GenerateSurfaceProperties(s) ;
- }
- }
-
- void GenerateSurfaceInstance(Surface *s)
- {
- if(!s) return ;
-
- fprintf(script,"surface %s\n",s->name) ;
- ind++ ;
- GenerateSurfaceProperties(s) ;
- fprintf(script,"\n") ;
- ind-- ;
-
- /*
- fprintf(script," {\n");
- fprintf(script," \"%s\",\n",s->name);
- fprintf(script," { %.4f,%.4f,%.4f },\n",s->amb.r,s->amb.g,s->amb.b);
- fprintf(script," { %.4f,%.4f,%.4f },\n",s->diff.r,s->diff.g,s->diff.b);
- fprintf(script," { %.4f,%.4f,%.4f },\n",s->spec.r,s->spec.g,s->spec.b);
- fprintf(script," { %.4f,%.4f,%.4f },\n",s->translu.r,s->translu.g,s->translu.b);
- fprintf(script," { %.4f,%.4f,%.4f },\n",s->body.r,s->body.g,s->body.b);
- fprintf(script," %.4f,\n",s->srexp);
- fprintf(script," %.4f,\n",s->stexp);
- fprintf(script," %.4f,\n",s->statten);
- fprintf(script," %.4f,\n",s->index);
- fprintf(script," %.4f,\n",s->reflect);
- fprintf(script," %.4f,\n",s->transp);
- fprintf(script," %.4f,\n",s->translucency);
- fprintf(script," %d,\n",s->noshadow);
- fprintf(script," NULL\n");
- fprintf(script," },\n");
- */
- }
-
- void GenerateTransforms(Trans *t)
- {
- Rotate *rot ;
- Scale *sca ;
- Translate *tra ;
- RSMatrix *mat;
-
- if(!t) return ;
- mat = &t->trans;
- if(!mat) return;
-
- fprintf(script,"transform %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f",
- mat->matrix[0][0],mat->matrix[0][1],mat->matrix[0][2],
- mat->matrix[1][0],mat->matrix[1][1],mat->matrix[1][2],
- mat->matrix[2][0],mat->matrix[2][1],mat->matrix[2][2],
- mat->translate.x,mat->translate.y,mat->translate.z);
-
- /* switch(TransformType(t)) {
- case TR_ROTATE:
- rot = t->tr ;
- fprintf(script,"rotate %.4f %.4f %.4f %.4f\n",rot->x,rot->y,rot->z,rot->theta) ;
- break ;
- case TR_SCALE:
- sca = t->tr ;
- fprintf(script,"scale %.4f %.4f %.4f\n",sca->x,sca->y,sca->z) ;
- break ;
- case TR_TRANSLATE:
- tra = t->tr ;
- fprintf(script,"translate %.4f %.4f %.4f\n",tra->x,tra->y,tra->z) ;
- break ;
- default:
- printf(" Bad transform found \n") ;
- }
- */
- }
-
- void GenerateTexture(Texture *t)
- {
- if(!t) return ;
- fprintf(script," texture ") ;
- switch(TextureType(t)) {
- case T_BLOTCH:
- fprintf(script,"blotch %.4f ",((Blotch *)t->data)->mix) ;
- GenerateSurface(((Blotch *)t->data)->surf) ;
- break ;
- case T_BUMP:
- fprintf(script,"bump %.4f ",((Bump *)t->data)->size) ;
- break ;
- case T_CHECKER:
- fprintf(script,"checker ") ;
- GenerateSurface(((Checker *)t->data)->surf) ;
- break ;
- case T_CLOUD:
- fprintf(script,"cloud %.4f %.4f %.4f %d %.4f %.4f %.4f ",
- ((CloudText *)t->data)->scale,
- (((CloudText *)t->data)->beta/2.)-1.,
- ((CloudText *)t->data)->lambda,
- ((CloudText *)t->data)->octaves,
- ((CloudText *)t->data)->cthresh,
- ((CloudText *)t->data)->range+((CloudText *)t->data)->cthresh,
- ((CloudText *)t->data)->transcale
- ) ;
- break ;
- case T_FBM:
- fprintf(script,"fbm %.4f %.4f %.4f %.4f %d %.4f ",
- ((FBm *)t->data)->offset,
- ((FBm *)t->data)->scale,
- (((FBm *)t->data)->beta/2.)-1.,
- ((FBm *)t->data)->lambda,
- ((FBm *)t->data)->octaves,
- ((FBm *)t->data)->thresh
- ) ;
- break ;
- case T_FBMBUMP:
- fprintf(script,"fbmbump %.4f %.4f %.4f %.4f %d ",
- ((FBm *)t->data)->offset,
- ((FBm *)t->data)->scale,
- (((FBm *)t->data)->beta/2.)-1.,
- ((FBm *)t->data)->lambda,
- ((FBm *)t->data)->octaves
- ) ;
- break ;
- case T_GLOSS:
- fprintf(script,"gloss ",((Gloss *)t->data)->glossy) ;
- break ;
- case T_IMAGE:
- fprintf(script,"/* Image mapping not supported by this release of Rayshade-M */") ;
- break ;
- case T_MARBLE:
- fprintf(script,"marble ") ;
- break ;
- case T_SKY:
- fprintf(script,"sky %.4f %.4f %.4f %d %.4f %.4f ",
- ((Sky *)t->data)->scale,
- (((Sky *)t->data)->beta/2.)-1.,
- ((Sky *)t->data)->lambda,
- ((Sky *)t->data)->octaves,
- ((Sky *)t->data)->cthresh,
- ((Sky *)t->data)->lthresh
- ) ;
- break ;
- case T_STRIPE:
- fprintf(script,"stripe ") ;
- GenerateSurface(((Stripe *)t->data)->surf) ;
- fprintf(script," %.4f %.4f ",((Stripe *)t->data)->width,((Stripe *)t->data)->bump) ;
- break ;
- case T_WOOD:
- fprintf(script,"wood ") ;
- break ;
- }
- if(t->trans) {
- Trans *tr ;
- tr = t->trans ;
- do {
- GenerateTransforms(tr);
- tr = tr->next ;
- } while(tr) ;
- }
- fprintf(script,"\n");
- }
-
-
- void GenerateObject(Geom *o)
- {
- int loop ;
-
- if(!o) return ;
-
- fprintf(script,"\n");
- ind++ ;
- switch(ObjectType(o)) {
- case PLANE:
- indent() ;
- fprintf(script,"plane ") ;
- GenerateSurface(o->surf) ;
- fprintf(script,"%.4f %.4f %.4f %.4f %.4f %.4f\n",
- ((Plane *)o->obj)->pos.x ,((Plane *)o->obj)->pos.y,
- ((Plane *)o->obj)->pos.z ,((Plane *)o->obj)->norm.x,
- ((Plane *)o->obj)->norm.y,((Plane *)o->obj)->norm.z) ;
- break ;
- case DISC:
- indent() ;
- fprintf(script,"disc ") ;
- GenerateSurface(o->surf) ;
- fprintf(script,"%.4f %.4f %.4f %.4f %.4f %.4f %.4f\n",
- ((Disc *)o->obj)->radius,((Disc *)o->obj)->pos.x,
- ((Disc *)o->obj)->pos.y ,((Disc *)o->obj)->pos.z,
- ((Disc *)o->obj)->norm.x,((Disc *)o->obj)->norm.y,
- ((Disc *)o->obj)->norm.z) ;
- break ;
- case SPHERE:
- indent() ;
- fprintf(script,"sphere ") ;
- GenerateSurface(o->surf) ;
- fprintf(script,"%.4f %.4f %.4f %.4f\n",
- ((Sphere *)o->obj)->r,((Sphere *)o->obj)->x,
- ((Sphere *)o->obj)->y,((Sphere *)o->obj)->z) ;
- break ;
- case TRIANGLE:
- {
- Triangle *tri ;
-
- tri = o->obj ;
- indent() ;
- fprintf(script,"triangle ") ;
- GenerateSurface(o->surf) ;
- fprintf(script,"\n") ;
- if(tri->type == FLATTRI) {
- for(loop = 0 ; loop < 3 ; loop++) {
- indent() ;
- fprintf(script,"%.4f %.4f %.4f\n",((Triangle *)o->obj)->p[loop].x,
- ((Triangle *)o->obj)->p[loop].y,
- ((Triangle *)o->obj)->p[loop].z) ;
- }
-
- }
- else {
- for(loop = 0 ; loop < 3 ; loop++) {
- indent() ;
- fprintf(script,"%.4f %.4f %.4f %.4f %.4f %.4f\n",
- ((Triangle *)o->obj)->p[loop].x,
- ((Triangle *)o->obj)->p[loop].y,
- ((Triangle *)o->obj)->p[loop].z,
- ((Triangle *)o->obj)->vnorm[loop].x,
- ((Triangle *)o->obj)->vnorm[loop].y,
- ((Triangle *)o->obj)->vnorm[loop].z) ;
- }
- }
- }
- break ;
- case POLYGON:
- indent() ;
- fprintf(script,"polygon ") ;
- GenerateSurface(o->surf) ;
- fprintf(script,"\n") ;
- for(loop = 0 ; loop < ((RPolygon *)o->obj)->npoints ; loop++) {
- indent() ;
- fprintf(script,"%.4f %.4f %.4f\n",((RPolygon *)o->obj)->points[loop].x,
- ((RPolygon *)o->obj)->points[loop].y,
- ((RPolygon *)o->obj)->points[loop].z) ;
- }
- break ;
- case BOX:
- indent() ;
- fprintf(script,"box ") ;
- GenerateSurface(o->surf) ;
- fprintf(script,"%.4f %.4f %.4f %.4f %.4f %.4f\n",
- ((Box *)o->obj)->bounds[0][0],((Box *)o->obj)->bounds[0][1],
- ((Box *)o->obj)->bounds[0][2],((Box *)o->obj)->bounds[1][0],
- ((Box *)o->obj)->bounds[1][1],((Box *)o->obj)->bounds[1][2]) ;
- break ;
- case CYLINDER:
- {
- Cylinder *cyl ;
- Vector dummy, bottom, top ;
- Float radius ;
-
- indent() ;
- fprintf(script,"cylinder ") ;
- GenerateSurface(o->surf) ;
-
- cyl = o->obj ;
- /* Top and bottom of our normalized cylinder */
- bottom.x = bottom.y = bottom.z = 0. ;
- top.x = top.y = 0. ; top.z = 1. ;
- /* Dummy is a point on the edge of our normalized cylinder */
- dummy.x = 1.0 ; dummy.y = dummy.z = 0. ;
-
- /* Now transform these points */
- PointTransform(&top,&cyl->trans.trans) ;
- PointTransform(&bottom,&cyl->trans.trans) ;
- PointTransform(&dummy,&cyl->trans.trans) ;
-
- /* The radius value is the distance between bottom and dummy */
- VecSub(bottom,dummy,&dummy) ;
- radius = VecNormalize(&dummy) ;
- fprintf(script,"%.4f %.4f %.4f %.4f %.4f %.4f %.4f\n",
- radius,bottom.x,bottom.y,bottom.z,top.x,top.y,top.z) ;
- }
- case CONE:
- {
- Cone *cone ;
- Vector bottomr, bottom, apex ;
- Float br, ar ;
-
- indent() ;
- fprintf(script,"cone ") ;
- GenerateSurface(o->surf) ;
-
- cone = o->obj ;
- /* apex and bottom of our normalized cone */
- bottom.x = bottom.y = 0 ; bottom.z = 1. ;
- apex.x = apex.y = 0. ; apex.z = cone->start_dist ;
- /* Point on the edge of our normalized cone */
- bottomr.x = 1.0 ; bottomr.y = 0 ; bottomr.z = 1. ;
-
- /* Now transform these points */
- PointTransform(&apex,&cone->trans.trans) ;
- PointTransform(&bottom,&cone->trans.trans) ;
- PointTransform(&bottomr,&cone->trans.trans) ;
-
- /* Now calculate the radii */
- VecSub(bottom,bottomr,&bottomr) ;
- br = VecNormalize(&bottomr) ;
- ar = cone->start_dist * br ;
- fprintf(script,"%.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f\n",
- br,bottom.x,bottom.y,bottom.z,
- ar,apex.x,apex.y,apex.z) ;
- }
- break ;
- case TORUS:
- {
- Torus *tor ;
- Vector norm, pos ;
-
- indent() ;
- fprintf(script,"torus ") ;
- GenerateSurface(o->surf) ;
-
- tor = o->obj ;
- pos.x = pos.y = pos.z = 0. ;
- norm.x = norm.y = 0. ; norm.z = 1. ;
- PointTransform(&pos,&tor->trans.trans) ;
- PointTransform(&norm,&tor->trans.trans) ;
- fprintf(script,"%.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f\n",
- tor->a,tor->b,pos.x,pos.y,pos.z,
- norm.x,norm.y,norm.z) ;
- }
- break ;
- case BLOB:
- {
- Blob *blob ;
- int loop ;
-
- indent() ;
- fprintf(script,"blob ") ;
- GenerateSurface(o->surf) ;
- blob = o->obj ;
- fprintf(script," %.4f\n",blob->T) ;
- ind++ ;
- for(loop = 0 ; loop < blob->num ; loop++) {
- indent() ;
- fprintf(script,"%.4f %.4f %.4f %.4f %.4f\n",
- blob->list[loop].c0,
- blob->list[loop].rs,
- blob->list[loop].x,
- blob->list[loop].y,
- blob->list[loop].z) ;
- }
- ind-- ;
- }
- break ;
- case HF:
- fprintf(script,"/* A height field object has been removed from the script !!*/\n") ;
- break ;
- case INSTANCE:
- {
- Geom *o2 ;
-
- o2 = Objects ;
- while(o2 && (o2 != ((Instance *)o->obj)->obj)) o2 = o2->next ;
- if(o2==((Instance *)o->obj)->obj) {
- indent() ;
- fprintf(script,"object ") ;
- GenerateSurface(o->surf) ;
- fprintf(script," %s\n",o2->name) ;
- }
- else
- fprintf(script,"/* Oh dear i just tried to generate a non-existant reference ! */\n") ;
- }
- break ;
- case CSG:
- {
- Csg *csg ;
-
- csg = o->obj ;
- indent() ;
- if(csg->operator == CSG_UNION)
- fprintf(script,"union\n") ;
- else if(csg->operator == CSG_INTERSECT)
- fprintf(script,"intersect\n") ;
- else if(csg->operator == CSG_DIFFERENCE)
- fprintf(script,"difference\n") ;
- GenerateObject(csg->obj1) ;
- GenerateObject(csg->obj2) ;
- indent() ;
- fprintf(script,"end\n") ;
- }
- break ;
- case LIST:
- {
- Geom *o2 ;
-
- indent() ;
- fprintf(script,"list\n") ;
- for(o2 = ((List *)o->obj)->list ; o2 ; o2 = o2->next)
- GenerateObject(o2) ;
- for(o2 = ((List *)o->obj)->unbounded ; o2 ; o2 = o2->next)
- GenerateObject(o2) ;
- indent() ;
- fprintf(script,"end\n") ;
- }
- break ;
- case GRID:
- {
- Geom *o2 ;
-
- indent() ;
- fprintf(script,"grid %d %d %d\n",
- ((Grid *)o->obj)->xsize,
- ((Grid *)o->obj)->ysize,
- ((Grid *)o->obj)->zsize) ;
- for(o2 = ((Grid *)o->obj)->objects ; o2 ; o2 = o2->next)
- GenerateObject(o2) ;
- for(o2 = ((Grid *)o->obj)->unbounded ; o2 ; o2 = o2->next)
- GenerateObject(o2);
- indent();
- fprintf(script,"end\n");
- }
- break ;
- }
- ind++ ;
- if(o->trans) {
- Trans *t ;
-
- t = o->trans ;
- do {
- indent() ;
- GenerateTransforms(t);
- t = t->next ;
- } while(t) ;
- }
- if(o->texture) {
- Texture *t ;
-
- t = o->texture ;
- do {
- indent() ;
- GenerateTexture(t);
- t = t->next ;
- } while (t) ;
- }
- ind-- ;
- ind-- ;
- printf("\n") ;
- }
-
- void GenerateObjectInstance(Geom *o)
- {
- if(!o) return ;
-
- fprintf(script,"name %s\n",o->name) ;
- GenerateObject(o) ;
- }
-
- void GenerateIntro()
- {
- fprintf(script,"/* Rayshade-M machine generated output */\n") ;
- }
-
- void GenerateEnd()
- {
- fprintf(script,"\n\n/* End of script */\n") ;
- }
-
- void GenerateInstances()
- {
- Light *l ;
- Surface *s ;
- Geom *o, *obuffer[100] ;
- int size,loop ;
-
- if(Lights) {
- fprintf(script,"\n/* Lights */\n") ;
- for(l = Lights ; l ; l = l->next)
- GenerateLightInstance(l) ;
- }
-
- if(Surfaces) {
- fprintf(script,"\n/* Surfaces */\n") ;
- for(s = Surfaces ; s ; s = s->next)
- GenerateSurfaceInstance(s) ;
- }
-
- /* Objects must be defined backwards - no forward referencing :( */
- if(Objects) {
- size = 0 ;
- fprintf(script,"\n/* Objects */\n") ;
- for(o = Objects ; o ; o = o->next)
- obuffer[size++] = o ;
- for(loop = size-1 ; loop >=0 ; loop--)
- GenerateObjectInstance(obuffer[loop]) ;
- }
- }
-
- void GenerateRenderOptions()
- {
- fprintf(script,"\n/* Render options */\n") ;
- fprintf(script,"background %.4f %.4f %.4f\n",Screen.background.r,Screen.background.g,Screen.background.b) ;
- if(Options.imgname)
- fprintf(script,"outfile %s\n",Options.imgname) ;
- fprintf(script,"contrast %.4f %.4f %.4f\n",Options.contrast.r,Options.contrast.g,Options.contrast.b) ;
- if(Options.shadowtransp)
- fprintf(script,"shadowtransp\n") ;
- fprintf(script,"\n") ;
- }
-
-
- void GenerateCameraInfo()
- {
- fprintf(script,"\n/* Camera options */\n") ;
- fprintf(script,"eyep %.4f %.4f %.4f\n",Camera.pos.x,Camera.pos.y,Camera.pos.z) ;
- fprintf(script,"lookp %.4f %.4f %.4f\n",Camera.lookp.x,Camera.lookp.y,Camera.lookp.z) ;
- fprintf(script,"up %.4f %.4f %.4f\n",Camera.up.x,Camera.up.y,Camera.up.z) ;
- fprintf(script,"fov %.4f %.4f\n", Camera.hfov,Camera.vfov) ;
- fprintf(script,"aperture %.4f\n",Camera.aperture) ;
- fprintf(script,"focaldist %.4f\n",Camera.focaldist) ;
- fprintf(script,"shutter %.4f\n",Options.shutterspeed) ;
- fprintf(script,"screen %d %d\n",Screen.xres,Screen.yres) ;
- }
-
- void GenerateObjects()
- {
- Geom *l ;
-
- fprintf(script,"\n/* The World */\n") ;
-
- /* The world is a list we dont want to see */
-
- for(l = ((List *)World->obj)->list ; l ; l = l->next)
- GenerateObject(l) ;
- for(l = ((List *)World->obj)->unbounded ; l ; l = l->next)
- GenerateObject(l) ;
- }
-
- void GenerateScript(char *name)
- {
- script = fopen(name,"w+") ;
- if(script) {
- GenerateIntro() ;
- GenerateRenderOptions() ;
- GenerateCameraInfo() ;
- GenerateInstances() ;
- GenerateObjects() ;
- GenerateEnd() ;
- fclose(script) ;
- }
- }