Go Back   AC3D Forums > Technical > AC3D Developers
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 4th March 2005, 09:17 AM   #1
monster
Member
Advanced member
 
Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 39
Default Plugin SDK Material Changes

I notice that the material structure is now defined as;
Code:
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
Code:
ACMaterial *ac_palette_get_material(int num);
How do we get ahold of the actual information about that material?
monster is offline   Reply With Quote
Old 4th March 2005, 10:14 AM   #2
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,563
Default

Like lots of things in AC3D 5, ACMaterials are ACEntity.

So, if ACMaterial *m;

Code:
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 );
Andy is offline   Reply With Quote
Old 4th March 2005, 11:00 AM   #3
monster
Member
Advanced member
 
Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 39
Default

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?
monster is offline   Reply With Quote
Old 4th March 2005, 11:23 AM   #4
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,563
Default

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 is offline   Reply With Quote
Old 4th March 2005, 11:34 AM   #5
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,563
Default

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
Andy is offline   Reply With Quote
Old 4th March 2005, 12:11 PM   #6
monster
Member
Advanced member
 
Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 39
Default

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.
monster is offline   Reply With Quote
Old 5th March 2005, 04:35 PM   #7
PerFnurt
Member
Expert member
 
Join Date: Aug 2003
Location: Eslöv, Sweden
Posts: 93
Default

It's in ac3dutil.tcl
__________________
/Per

www.perfnurt.se
PerFnurt is offline   Reply With Quote
Old 5th March 2005, 05:05 PM   #8
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,563
Default

Thanks Per!

Sorry for directing you to the wrong file ops:
Andy is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 04:44 PM.


AC3D Forum
(C) Inivis Limited 2020