Keyable Material Attributes

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Keyable Material Attributes

Post by dlangdev »

Has anybody got any code related to Keyable Material Attributes. I'd like to play around with Irrlicht code and learn about it.

If there isn't, I guess I'll have to use the code behind CSkinnedMesh and CAnimatedMeshSceneNode as a starting point.

Anyway, what do I mean Keyable Material Attributes?

(1) Keyable means a key can be set and a key will have a frame number.

(2) Materials are attached to a mesh.

(3) Attributes are values attached to a materials, such as specular intesity, diffuse color, etc.

Putting them together, it basically means an attribute having the ability of changing values over a timeframe.

Thanks in advance for your advice.
Image
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

Here is a snippet of where this is going...

Code: Select all

Material
   AmbientColor
       Red,Gree,Blue
   DiffuseColor
       Red,Gree,Blue
   EmissiveColor
       Red,Gree,Blue
   SpecularColor
       Red,Gree,Blue



IKeyable* key1 = new KeyAttributeValueF(&Material->AmbientColor.red);
key1->setFrame(0  , 0.0f);
key1->setFrame(300, 0.8f);
key1->setFrame(400, 1.0f);


IKeyable* key2 = new KeyAttribute(&Material->DiffuseColor);
key2->setFrame(0  , SColor(0,0,0));
key2->setFrame(300, SColor(143,80,212));
key2->setFrame(400, SColor(255,255,255));
Image
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

So you basically want to interpolate between diffuse colours (or others) of the mesh based on the current frame?

That should be pretty easy to do... just find out the difference between the current frame and your key frames and interpolate the colour, just do that every frame....
Image Image Image
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

Hey, thanks for the info.

Regarding interpolation...

I'm trying another method which is new to me, about parametric equations and simultaneous equations. Has anyone written code that will implement an interpolated value at certain time (Tx) using parametric equations and simultaneous equations?

I know this will take me to Linear Algebra with all those vectors and matrices, tho what I'm after is an API that is implemented in C++ that can be added on top of IrrLib.

Which may be the tool I'm looking for-->implementing a dope sheet.
Image
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

Image
Post Reply