Color maps in Open Inventor ASCII file format


I’m currently working on a C/C++ program which writes out Open Inventor files in ASCII format. I need to color a PointSet according to a color map but I dont seem to be able to find out how to do it.

The idea is having something like a color map and then refering to the colors by their index, so if I want to change colors I just need to edit the color map.

I can successfully accomplish that on surfaces by defining a Material with as many diffuseColor’s as I want and then using IndexedFaceSet and materialIndex. The PointSet node however doesnt have a materialIndex tag nor I seem to be able to define a color map and then color each point according to the colors index.

Any ideas of how I could do that? Even how I could define a color map and assign the colors to the points (or vertex) without using a Material?