go to www.geomview.org home page
 
Home

Overview
FAQ
Documentation

Download

Mailing List

Geomview For Windows?

Support
Users
Development

Bug Reporting
Contributing
Contact Us

Sponsors

 

Site Search

 

Advanced
Search

 
About the software@geom archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

forms control



You can use the colormap index you get back to look up the RGB colors
with fl_getmcolor. Note that you'll get back integers 0-255, while
Geomview wants RGB values of 3 floats ranging from 0-1. See below for
a working example.

Tamara Munzner          ((555) 555-5555
munzner at geom.umn.edu    The Geometry Center  
------------------------------------------------------------------------

#include <stdio.h>
#include "forms.h"

main()
{
  FILE *togv = stdout;
  short face[3];
  short newcol;

  /* get integer index into Forms colormap */
  /* note that we're passing in a bogus old value */
  newcol = fl_show_colormap(1);

  /* get face rgb values from colormap: integers 0-255 */
  fl_getmcolor(newcol, &face[0], &face[1], &face[2]);

  /* tell geomview the new colors, as floats 0-1 */
  fprintf(togv, "(merge-ap targetgeom {appearance {material {*diffuse \
                  %2.3f %2.3f %2.3f}}})",
	  face[0]/255.0, face[1]/255.0, face[2]/255.0);
}


  
  


  • References:
    • forms control
      • From: "William Anderst" <wanderst at yolanda.hper.indiana.edu>
 
Home | Overview | FAQ | Documentation | Support | Download | Mailing List
Windows? | Development | Bug Reporting | Contributing | Contact Us | Sponsors
 
site hosted by
SourceForge Logo