Setting surface colour/sidedness


New member
I'm currently writing an importer and trying to change the surface colour from the default surface values, i.e. 200, 200, 200 and single sided. I've managed to create a new surface with surff->create(objectname, materialname) and it is present when looking in the surface editor.

The setFlt and setInt are in the lwsurf.h file.

double *dval;
dval = new double[3];
dval[0] = 255 / 255;
dval[1] = 250 / 255;
dval[2] = 250 / 255;
surff->setFlt(surfid, SURF_COLR, dval);

I've also tried to set the sidedness of the surface with

surff->setInt(surfid, SURF_SIDE, sided);

where sided is an int value 1;

Anyone ever used these functions and got them to work.




New member
In case anyone needs to know how to set the colour, I finally managed to find out how make it work.

I set the variable to get the surface id to

LWSurfaceID *surfid;

I retrieved the surfid using

surfid = surff->byName(surfacename, objname);

and changed

surff->setFlt(surfid, SURF_COLR, dval); to

surff->setFlt(surfid[0], SURF_COLR, dval);

Top Bottom