View Full Version : Plugin SDK Material Changes
monster
4th March 2005, 08:17 AM
I notice that the material structure is now defined as;
typedef struct material_t
{
int dummy;
// private
} ACMaterial; // private ACEntity
typedef struct material_template_t
{
ACrgb rgb; // diffuse
ACrgb ambient;
ACrgb specular;
ACrgb emissive;
float shininess;
float transparency;
} ACMaterialTemplate;
So, given that a surface holds an index to it's material in the palette, and that we can get the actual material with
ACMaterial *ac_palette_get_material(int num);
How do we get ahold of the actual information about that material?
Andy
4th March 2005, 09:14 AM
Like lots of things in AC3D 5, ACMaterials are ACEntity.
So, if ACMaterial *m;
ACrgb rgb;
Float val;
ac_entity_get_rgb_value( (ACEntity *)m, "diffuse", &rgb );
ac_entity_get_rgb_value( (ACEntity *)m, "ambient", &rgb );
ac_entity_get_rgb_value( (ACEntity *)m, "specular", &rgb );
ac_entity_get_rgb_value( (ACEntity *)m, "emissive", &rgb );
ac_entity_get_float_value( (ACEntity *)m, "shininess", &val );
ac_entity_get_float_value( (ACEntity *)m, "transparency", &val );
monster
4th March 2005, 10:00 AM
Riiiight.
:?
Is this documented anywhere?
What "things" are entities (I'm guessing all the "#define AC_CLASS..." things) and what resname's are supported by each class, and what the types of those res's are?
Andy
4th March 2005, 10:23 AM
Not yet sorry.
ACEntities include view windows, objects, images (for textures and bg images).
You can find out what's in there if you edit tcl/ac3dview.tcl. Look for:
########## SIMPLE GLOBAL ENTITY BROWSER
remove the following 'return' line and start AC3D to see a simple entity browser.
(There is a small bug when reading rgb values from tcl but this is fixed for the bugfix release)
Andy
Andy
4th March 2005, 10:34 AM
Note that you may see a number of 'exciting' entity resource names if you do the above. Most are for future use and are not currently active in 5.0 - so don't get too excited...
Andy
monster
4th March 2005, 11:11 AM
Hmm, that doesn't seem to be in my version of tcl/ac3dview.tcl, which is a shame 'cos I was looking forward to seeing the exciting new entity names!
Thanks for the info Andy, I've got what I needed (for now) from your original reply. I'm just being greedy wanting more information now.
Cheers.
PerFnurt
5th March 2005, 03:35 PM
It's in ac3dutil.tcl
Andy
5th March 2005, 04:05 PM
Thanks Per!
Sorry for directing you to the wrong file :oops:
vBulletin® v3.8.5, Copyright ©2000-2010, Jelsoft Enterprises Ltd.