Page 1 of 1

Array of nodes

Posted: Fri Mar 02, 2007 12:38 pm
by FumarMata
Hello everybody

I want to create an array of cubes to modify each one's parametres independently to create some effects, but after trying and trying, I have not been able to accomplish that task (I know other languages, but I am a newbie in both Irrlicht and C++)

I was thinking about creating an array of nodes, each one containing one of the cubes, but I have not been able to do that. I think that it should look like similar to this:

Code: Select all

	
IAnimatedMesh* mesh = smgr->getMesh("../../meshes/cube.3ds");
// INSTEAD OF node THERE SHOULD BE SOMETHING LIKE node[0], node[1],... ?
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );

// extra code   
core::vector3df scale;
scale.X = scale.Y = scale.Z = 15;

// AND HERE THE SAME: INSTEAD OF OF node THERE SHOULD BE SOMETHING LIKE node[0], node[1],... ?

node->setScale(scale);

Thanks in advance! :)

Posted: Fri Mar 02, 2007 2:25 pm
by arras

Code: Select all

IAnimatedMeshSceneNode* node[100];
for(int i=0; i<100; i++) node[i] = smgr->addAnimatedMeshSceneNode( mesh );

Posted: Fri Mar 02, 2007 5:55 pm
by FumarMata
Perfect!

thanks arras :)