Page 1 of 1
Picking Invisible Objects
Posted: Wed Oct 28, 2009 1:56 pm
by spidersharma
Hi,
I am Interested in picking invisible objects in Irrlicht.
Is it possible?
Posted: Wed Oct 28, 2009 5:10 pm
by CuteAlien
I think you can pick the triangles of invisible nodes, but you can't use the functions which are using CSceneCollisionManager::getPickedNodeBB (basically all functions for picking nodes) as that has an isVisible check. If you remove that it would work.
I think we should separate visibility from collision some day as I do in my games a lot more checks for invisible nodes and triangles than for visible nodes as I usually have an own collision geometry. And I suppose other people do the same.
Posted: Thu Oct 29, 2009 3:33 am
by spidersharma
Hi,
Can we make the object of intrest 100% transparent and pick?
Right now Idon't need more than 3 pickable planes.
My Idea is to do 3dsmax style translation gizmos.
for that I need 3 invisible planes which are pickable.
Posted: Thu Oct 29, 2009 4:30 am
by CuteAlien
You can use some mesh make that invisible and use selectors. The problem with invisibility happens only with node-picking functions. Selectors will work.
Posted: Thu Oct 29, 2009 4:45 am
by spidersharma
If we make a meshNode invisible, will it be even registered for rendering?
Posted: Thu Oct 29, 2009 12:25 pm
by garrittg
greetings

for RetroTank3D i needed invisible tanks but still needed collision support. instead of ISceneNode.setVisible, i used:
ISceneNode.setMaterialType(EMT_TRANSPARENT_ALPHA_CHANNEL)
to make them invisible and
ISceneNode.setMaterialType(EMT_SOLID)
to make them visible again. i think the same should work for you well.
HTH.
Posted: Thu Oct 29, 2009 12:51 pm
by spidersharma
Thanks a lot.
Posted: Thu Oct 29, 2009 1:18 pm
by CuteAlien
spidersharma wrote:If we make a meshNode invisible, will it be even registered for rendering?
Very good point. I've currently static collision geometry so that didn't matter. But you are right - it won't register, but probably you could call registerNodeForRendering from ISceneManager to force it to register.
Posted: Thu Oct 29, 2009 1:54 pm
by hybrid
If you want to make a scene node invisible, it's much simpler with 1.6 to use the OverrideMaterial. Also, to speed things up, you should disable the color planes instead, which would render only to depth buffer, or also disable that one. Both can be changed with only one (resp. two) calls to the SMaterial Flags, which is much faster than changing all materials. Moreover, it won't mess with transparent materials etc. Hope this helps.
Posted: Thu Oct 29, 2009 4:24 pm
by spidersharma
Thanks a lot for this valuable suggestion.
Posted: Mon Nov 02, 2009 12:34 pm
by johann_gambolputty
setMaterialFlag(video::EMF_FRONT_FACE_CULLING, true);
works fine for me

Posted: Mon Nov 02, 2009 2:20 pm
by Lonesome Ducky
johann_gambolputty wrote:setMaterialFlag(video::EMF_FRONT_FACE_CULLING, true);
works fine for me

Ah yes, but you'd have to be sure back face culling is enabled too, otherwise the back would be drawn.
Posted: Mon Nov 02, 2009 3:20 pm
by hybrid
Please note, though, that this only handles faces, i.e. lines and points might still be drawn, and DirectX cannot handle this mode at all. Moreover, disabling the framebuffer should be much faster.