set Vertex Color Alpha

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
rt
Posts: 150
Joined: Sun Nov 30, 2003 6:54 am
Location: canada
Contact:

set Vertex Color Alpha

Post by rt »

what i would like to do is display an ISceneNode created from a static 3d mesh with slight alpha blending. after searching throught the source code i found setVertexColorAlpha(), but i must be using it wrong because the model's alpha is staying the same regardless of what value i use :?:

Code: Select all

	IAnimatedMeshSceneNode* node;
		IAnimatedMesh* mesh = smgr->getMesh("..\\..\\media\\sydney.md2");
		smgr->getMeshManipulator()->setVertexColorAlpha(mesh->getMesh(0),128);
		node = smgr->addAnimatedMeshSceneNode( mesh );

		if (node)
		{
			node->setMaterialFlag(EMF_LIGHTING, false);
			node->setFrameLoop(0, 310);	
			node->setMaterialTexture( 0, driver->getTexture("../../media/sydney.bmp") );
			node->setPosition(core::vector3df(i*50-500,0,0));
		}
...
<rendering code>
i would expect the model to show up half transparent, but that is not what happens (see pic)

Image

can anyone inform me as to what's going on?
Boogle
Posts: 162
Joined: Fri Nov 21, 2003 3:16 pm
Location: Toronto, Canada

Post by Boogle »

There appears to be a Material type called:

EMT_TRANSPARENT_VERTEX_ALPHA

What if you try this out?
rt
Posts: 150
Joined: Sun Nov 30, 2003 6:54 am
Location: canada
Contact:

^

Post by rt »

Boogle wrote:There appears to be a Material type called:

EMT_TRANSPARENT_VERTEX_ALPHA

What if you try this out?
good call. works perfect!
Post Reply