Noob question on Ogre
Posted: Sun Feb 13, 2005 11:50 pm
Hi - At the moment working through the tutorials and I'm breaking loose a bit and trying to render 3 ships in a row along the X axis.
This is my code:
Obviosly in the header I have:
It builds fine and everything but won't run - it tells me that there's already an object called "myShip". Does this mean I'll have to create 3 "mShip" Entities rather than try render the same one 3 times in different positions in the same scene?
I know I can do this in other 3D graphics packages to save on the total number of objects loaded in, I was just wondering if there's any [simple] way round it.
Again, I've just started using Ogre and have a basic understanding of C++ so if I've made a stupid mistake, please be gentle
This is my code:
Code: Select all
for(int i=0; i<3;i++)
{
mShip = mSceneMgr->createEntity("myShip","razor.mesh");
mShipNode[i] = mSceneMgr->getRootSceneNode()->createChildSceneNode();
mShipNode[i]->attachObject(mShip);
}
//set position of ships
mShipNode[0]->setPosition(-100, 0, 0);
mShipNode[1]->setPosition( 0, 0, 0);
mShipNode[2]->setPosition( 0, 0,-100);Code: Select all
Entity* mShip;
SceneNode *mShipNode[3];I know I can do this in other 3D graphics packages to save on the total number of objects loaded in, I was just wondering if there's any [simple] way round it.
Again, I've just started using Ogre and have a basic understanding of C++ so if I've made a stupid mistake, please be gentle
