alpha channel and collision question...

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
Tr3nT
Posts: 65
Joined: Thu Nov 29, 2007 5:19 pm

alpha channel and collision question...

Post by Tr3nT »

i have two question for you:
when i have to set the alpha channel to the gui(like the user-interface tutorial) i apply this to the whole gui set, but i need than one and only one element(a table with his set of buttons) become invisible, and the others no...
how can i do it?

the second question is about colliding: i know how to do a octreescenenode with a quake level, but how can i make a simple cubescenenode with colliding?(the other thing it has to collide is a normal sidney scene node...)
can u help me also with this one??

thanks....
Psan
Posts: 16
Joined: Sun Oct 04, 2009 7:07 pm

Post by Psan »

I guess you need to do it with createCollisionResponseAnimator. There is an example in folder "collision" in examples.

You need to select triangles of the model in oct tree and add anim to the cube.

Should work, but I'm not so sure. :D
CuteAlien
Admin
Posts: 9720
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Sorry, you can't set the colors for a single element currently. At least not for the tableelement. So at the moment you have to make an own gui-element for this (copy the table, rename it and change the stuff you need). We need a better solution for overriding all skin-values per element, but it's not here yet.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Tr3nT
Posts: 65
Joined: Thu Nov 29, 2007 5:19 pm

Post by Tr3nT »

maybe i'm wrong, but when i tried to apply the octree scene node to the cube but it give me an error cause i think i need a mesh to apply the octreescenenode because it says that there must be a ianimated scene node, non a simply i scene node...

but i need to usce a cubescene node...

how can i do it???


and for alien..thanks..i was losing a lot of time with it...
i'll make it simply pop in the sceen...
CuteAlien
Admin
Posts: 9720
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

You don't need an octree for a cube, so you can use ISceneManager::createTriangleSelector. That can also take a mesh as parameter.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Tr3nT
Posts: 65
Joined: Thu Nov 29, 2007 5:19 pm

Post by Tr3nT »

i'm really a newbie..
how can i take the mesh of the cube???
i've tried, the game starts but there is no collision between the node(sidney and the cube,....
i post a bit of code:

Code: Select all

  scene::ISceneNode* n = smgr->addCubeSceneNode(100,0,0,vector3df(0,0,0));
    
    scene::ITriangleSelector* selector = 0;
    selector = smgr->createTriangleSelector(0,n);
    n->setTriangleSelector(selector);
	
	
    IAnimatedMesh* mesh = smgr->getMesh("sydney.md2");
	IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode(mesh);
    
    if (selector)
	{
		scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(selector,node, core::vector3df(30,60,30), core::vector3df(0,0,0));
		node->addAnimator(anim);
		anim->drop();
	}
    
    
	if (node)
	{
		node->setMaterialFlag(EMF_LIGHTING, false);
		node->setMD2Animation(scene::EMAT_STAND);
		node->setMaterialTexture( 0, driver->getTexture("sydney.bmp") );
	    
    }
Tr3nT
Posts: 65
Joined: Thu Nov 29, 2007 5:19 pm

Post by Tr3nT »

sorry for the up, but noone can help me??
i really don't understand where the error is....
Post Reply