[fixed]object that always infront

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
Virion
Competition winner
Posts: 2149
Joined: Mon Dec 18, 2006 5:04 am

[fixed]object that always infront

Post by Virion »

i have this 3 arrows that use to move objects around in my level editor. but it's hidden inside the body of selected object. how to make it appear infront everything? do i need a second scene manager?

i tried with different viewport but i'm stuck because it seems to render the whole scene twice which makes no difference. how to render only the arrows in the second viewport and exclude the other from it? thanks.
Last edited by Virion on Mon Feb 15, 2010 8:38 am, edited 1 time in total.
My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
DavidJE13
Posts: 165
Joined: Tue Jan 09, 2007 7:17 pm

Post by DavidJE13 »

disable z-testing in the material and render the nodes manually after the scene is drawn, with node->render( );
You can also make the objects invisible so that they aren't rendered twice.
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

I seem to remember someone saying that node->render() doesn't apply transformations and such. I remember them saying to hide all the other objects and draw just that one. But disabling z-testing may be the wrong way to go, as faces in the object may be drawn over one another in a way they shouldn't. I'd say either render the object to a texture and draw that over the screen or just clear the z-buffer and just render that object normally.
DavidJE13
Posts: 165
Joined: Tue Jan 09, 2007 7:17 pm

Post by DavidJE13 »

node->render() will apply transformations if used after a smgr->drawAll(); call, because the transformations will still be in effect.
You're right about it rendering some parts out-of-order, which could be a problem, but for simple shapes it will usually be ok (back face culling will prevent most defects).
Clearing the z-buffer before drawing it is a good idea; I can't see any problems you would get.
Virion
Competition winner
Posts: 2149
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

THANKS! The suggestions were useful.

Image
My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
Post Reply