Hi,
a silly question:
Is it possible to load a mesh once but display it many times at different locations?
The background of my question:
I want ot write a 3d text class, where each character is represented via a mesh. So i want to load the whole alphabet into the application and whenever i want to display an "A" for instance use the loaded A.3ds.
normaly i would have a node of the loaded mesh but each node can be at one place at a distinct time not at two ore more.
I hope i was able to make my problem clear.
Greetings
Markus
load a mesh once and display it many times?
I think it is the usual way. Loading the mesh again for every model needs a lot of extra memory.
Code: Select all
// Load mesh once
scene::IAnimatedMesh* letterAmesh =
smgr->getMesh("data/A.3ds");
// Use it a lot of times (lot of nodes, the same mesh)
scene::IAnimatedMeshSceneNode* node1 =
smgr->addAnimatedMeshSceneNode(letterAmesh);
scene::IAnimatedMeshSceneNode* node2 =
smgr->addAnimatedMeshSceneNode(letterAmesh);
And then use:
to place nodes over the world.
Code: Select all
node1.setPosition (const core::vector3df &newpos)
node2.setPosition (const core::vector3df &newpos)
Great!
that was what i've searched.
Thanks to all of you!
I was not aware of the fact that loading a mesh an creating a scenenode can be done separately.
Until now i always did both steps in one by using a custom function "loadModelAtPos".
If i had looked into it i could have find it out on my own.
Thanks again for routing me in the right direction.
Happy coding
Markus
that was what i've searched.
Thanks to all of you!
I was not aware of the fact that loading a mesh an creating a scenenode can be done separately.
Until now i always did both steps in one by using a custom function "loadModelAtPos".
If i had looked into it i could have find it out on my own.
Thanks again for routing me in the right direction.
Happy coding
Markus