|
24th September 2013, 09:23 AM | #1 |
Junior Member
Member
Join Date: Aug 2013
Location: London UK
Posts: 22
|
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 |
26th September 2013, 07:52 AM | #2 |
Junior Member
Member
Join Date: Aug 2013
Location: London UK
Posts: 22
|
Re: PLugin writing
Aha I answer my own question.
ACrgb blck; blck.r= blck.g=blck.b=0; ACMaterial *num = ac_new_material_rgb(thergb); // material diffuse colour ac_entity_set_float_value((ACEntity *)num, "shininess", 2.0); ac_entity_set_rgb_value((ACEntity *)num, "specular", &blck); changes the new material to have shininess of 2 and no specular colour component. |
Tags |
bug, material, plugin |
|
|