Thread: PLugin writing
View Single Post
Old 24th September 2013, 09:23 AM   #1
Geoffm
Junior Member
Member
 
Geoffm's Avatar
 
Join Date: Aug 2013
Location: London UK
Posts: 22
Exclamation PLugin writing

I am adding new materials to a model via the ac_plugin.h interface. I create a new material with the desired ambient colour; however it is supplied with a shininess of 128. There is no option to change the shininess of a material (or its transparency, specular colour etc) which is highly desirable.

I tried using Material template like this:
ACMaterialTemplate matt;
matt.shininess = 1.0;
matt.ambient.r = (float)rgb[0]/(npts);
matt.ambient.g = (float)rgb[1]/(npts);
matt.ambient.b = (float)rgb[2]/(npts);
icol = ac_palette_get_new_material_index(&matt);

but this creates new materials that are ambient = black. rgb is in the range 0,256 so I tried scaling all colours by dividing by 256, or by multiplying by 256 with no useful results. Except that sometimes the material editor would not allow the colour to be edited.

Is this a known bug, and can we have routines to access the shininess, transparency, and other colour properties please.

GWM
Geoffm is offline   Reply With Quote