From f6b8e0eae4374f339487a33e3e4fe5462d5816e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 25 Nov 2017 10:16:00 +0100 Subject: New upstream version 2.0.0 --- plot/vrml.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) mode change 100644 => 100755 plot/vrml.c (limited to 'plot/vrml.c') diff --git a/plot/vrml.c b/plot/vrml.c old mode 100644 new mode 100755 index d56e62d..ebe69a9 --- a/plot/vrml.c +++ b/plot/vrml.c @@ -70,7 +70,8 @@ static void cs2xyz(vrml *s, double *out, double *in) { } /* Add a sphere at the given location, with transparency. */ -/* if col[] is NULL, use natural color. */ +/* If col[] is NULL, use natural color. */ +/* rad is in normalized delta E scale units */ /* Need to do this before or after start_line_set()/dd_vertex()/make_lines() ! */ static void add_marker_trans(vrml *s, double pos[3], double col[3], double trans, double rad) { double rgb[3], xyz[3]; @@ -97,7 +98,7 @@ static void add_marker_trans(vrml *s, double pos[3], double col[3], double trans fprintf(s->fp," Transform { translation %f %f %f\n", xyz[0], xyz[1], xyz[2]); fprintf(s->fp," children [\n"); fprintf(s->fp," Shape{\n"); - fprintf(s->fp," geometry Sphere { radius %f }\n", s->scale * rad); + fprintf(s->fp," geometry Sphere { radius %f }\n", rad); fprintf(s->fp," appearance Appearance { material Material { \n"); if (trans > 0.0) { fprintf(s->fp," transparency %f, \n",trans); @@ -119,7 +120,7 @@ static void add_marker_trans(vrml *s, double pos[3], double col[3], double trans fprintf(s->fp," \n", rgb[0], rgb[1], rgb[2]); } fprintf(s->fp," \n"); - fprintf(s->fp," \n",s->scale * rad); + fprintf(s->fp," \n",rad); fprintf(s->fp," \n"); fprintf(s->fp," \n"); } @@ -127,6 +128,7 @@ static void add_marker_trans(vrml *s, double pos[3], double col[3], double trans /* Add a sphere at the given location. */ /* if col[] is NULL, use natural color. */ +/* rad is in normalized delta E scale units */ /* Need to do this before or after start_line_set()/dd_vertex()/make_lines() ! */ /* (Hasn't been fixed to work in RGB space) */ static void add_marker(vrml *s, double pos[3], double col[3], double rad) { @@ -134,6 +136,7 @@ static void add_marker(vrml *s, double pos[3], double col[3], double rad) { } /* Add a cone marker to the plot. col == NULL for natural color */ +/* rad is in normalized delta E scale units */ /* Need to do this before or after start_line_set()/dd_vertex()/make_lines() ! */ static void add_cone(vrml *s, double pp0[3], double pp1[3], double col[3], double rad) { double rgb[3]; @@ -232,7 +235,7 @@ static void add_cone(vrml *s, double pp0[3], double pp1[3], double col[3], doubl fprintf(s->fp," translation %f %f %f\n",loc[1], loc[2], loc[0]); fprintf(s->fp," children [\n"); fprintf(s->fp," Shape { \n"); - fprintf(s->fp," geometry Cone { bottomRadius %f height %f }\n",s->scale * rad,len); + fprintf(s->fp," geometry Cone { bottomRadius %f height %f }\n",rad,len); fprintf(s->fp," appearance Appearance { material Material { diffuseColor %f %f %f } }\n",rgb[0],rgb[1],rgb[2]); fprintf(s->fp," } \n"); fprintf(s->fp," ]\n"); @@ -246,7 +249,7 @@ static void add_cone(vrml *s, double pp0[3], double pp1[3], double col[3], doubl fprintf(s->fp," \n"); fprintf(s->fp," \n", rgb[0], rgb[1], rgb[2]); fprintf(s->fp," \n"); - fprintf(s->fp," \n",s->scale * rad, len); + fprintf(s->fp," \n",rad, len); fprintf(s->fp," \n"); fprintf(s->fp," \n"); } @@ -254,6 +257,7 @@ static void add_cone(vrml *s, double pp0[3], double pp1[3], double col[3], doubl } /* Add a text marker to the plot. col == NULL for natural color */ +/* size is in normalized delta E scale units */ /* (Need to do this before or after start_line_set()/dd_vertex()/make_lines() !) */ static void add_text(vrml *s, char *text, double p[3], double col[3], double size) { double rgb[3], xyz[3]; @@ -282,7 +286,7 @@ static void add_text(vrml *s, char *text, double p[3], double col[3], double siz fprintf(s->fp," Shape{\n"); fprintf(s->fp," geometry Text { string [\"%s\"]\n",text); fprintf(s->fp," fontStyle FontStyle { family \"SANS\" style \"BOLD\" size %f }\n", - s->scale * size); + size); fprintf(s->fp," }\n"); fprintf(s->fp," appearance Appearance { material Material "); fprintf(s->fp,"{ diffuseColor %f %f %f } }\n", rgb[0], rgb[1], rgb[2]); @@ -298,7 +302,7 @@ static void add_text(vrml *s, char *text, double p[3], double col[3], double siz fprintf(s->fp," \n", rgb[0], rgb[1], rgb[2]); fprintf(s->fp," \n"); fprintf(s->fp," \n",text); - fprintf(s->fp," \n", s->scale * size); + fprintf(s->fp," \n", size); fprintf(s->fp," \n"); fprintf(s->fp," \n"); fprintf(s->fp," \n"); @@ -1432,7 +1436,6 @@ double vdist s->off = 50.0; /* z axis offset */ } - /* Create filename with the right exension */ { char *xl = NULL; -- cgit v1.2.3