what i want to do it render the world via smgr->drawAll() and then i want to render a single node multiple times at different positions within the same scene.
the problem is that if i simply call node->render() then the node doesn't show up, but if i call node->render() followed by node->onPostRender(0) then the node does show up.
my questions is what is the correct method to render a single node multiple times? should i be calling onPreRender() too? why does it not work when onPostRender() is omitted? of course all of this rendering code is between a beginscene and an endscene. thx!
OnPostRender updates the object's position (setPosition and setRotation will prepare for updating the translation matrix for the object, but the new translation isn't created until updateAbsolutePosition is called, in OnPostRender). This is why ommitting it will cause the object to not be rendered again.. Technically it is being rendered but at the same location as previously.
OnPreRender tells all of the nodes children to prepare for rendering, so that when smgr->drawAll() is called, the object's children are also drawn. You should not have to use this in your case.
As for the 'correct' method to render an object multiple times, whichever method does what you want is correct.. However perhaps it would be better to have multiple objects in the positions you would like? What was your reasoning for sticking with one node and moving it around each render loop?
Boogle wrote:As for the 'correct' method to render an object multiple times, whichever method does what you want is correct.. However perhaps it would be better to have multiple objects in the positions you would like? What was your reasoning for sticking with one node and moving it around each render loop?
thanks for the tip! if i call updateAbsolutePosition() after modifing the node's position then the render is correct however, in order to call that function directly i had to make it a public function in ISceneNode, but i found that i needed to do the same thing in order to stop my derived camera class from having some 'jumpy' render problems. the only problem i have left to figure out is this one (http://irrlicht.sourceforge.net/phpBB2/ ... .php?t=616)
the reason that i want to move one (or more) nodes around each render loop is because i added a feature to my game which allows the user to see the 'future' of an object (and it's effect on others) at each time step without having to actually move the object and chage it's position. in the render loop i run my updatelogic function to move all the objects and then render their position over and over until they have all stopped moving. it's a very useful effect