Array of nodes

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
FumarMata
Posts: 13
Joined: Fri Mar 02, 2007 12:26 pm

Array of nodes

Post 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! :)
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

Code: Select all

IAnimatedMeshSceneNode* node[100];
for(int i=0; i<100; i++) node[i] = smgr->addAnimatedMeshSceneNode( mesh );
FumarMata
Posts: 13
Joined: Fri Mar 02, 2007 12:26 pm

Post by FumarMata »

Perfect!

thanks arras :)
Post Reply