exotic.c and VRML 1

Compiling, libraries, modules, coding guidelines and porting

Moderators: jesterKing, stiv

Post Reply
leope
Posts: 0
Joined: Mon Apr 05, 2004 1:26 pm

exotic.c and VRML 1

Post by leope »

A little proposal for the exotic.c file to allow the export of emitting and smoothed meshes.

Code: Select all

...
fprintf(fp, "\t\tdiffuseColor %f %f %f\n", ma->r, ma->g, ma->b);
fprintf(fp, "\t\tspecularColor %f %f %f\n", ma->specr,ma->specg,ma->specb);
/* begin mod */
fprintf(fp, "\t\temissiveColor %f %f %f\n", ma->emit, ma->emit, ma->emit);
if(ma->har==1)
    fprintf(fp, "\t\tshininess %f \n", 0.000000);
else
    fprintf(fp, "\t\tshininess %f \n", ((float)ma->har)/100.0);
/* end mod */
...

Maybe the follow code is wrong (too high numbers returned ?), but with pane renderer seems to work.

Code: Select all

....
               fprintf(fp, "\t\tMaterialBinding { value PER_VERTEX_INDEXED }\n");
        }

        /* begin mod */
        if (me->flag & ME_AUTOSMOOTH)
        {
          fprintf(fp, "\t\tShapeHints {\n");
          fprintf(fp, "\t\t\t\t creaseAngle %f\n", (float) me->smoothresh*180/M_PI);
          fprintf(fp,  "\t\t}\n");
        }
       /* end mod */
 
        fprintf(fp, "\t\tCoordinate3 {\n");
        fprintf(fp, "\t\t\tpoint [\n");
...

leope

Post Reply