Page 1 of 1
accurate object picking
Posted: Fri Jan 09, 2009 10:40 am
by mickeyren
Hi
Can we have an accurate object picking included in the scene manager? Right now we only have bounding box picking using the RaySceneQuery.
I hope it can be extended down to polygon level picking.
Thanks.
Re: accurate object picking
Posted: Fri Jan 09, 2009 3:01 pm
by xadhoom
Re: accurate object picking
Posted: Wed Jan 21, 2009 7:16 am
by mickeyren
Though i wish that this feature is included into Ogre - doesn't mean if Ogre is just a rendering engine this should not be included. Ultimately this is a very useful tool like what have been discussed here by gerds -
http://www.ogre3d.org/forums/viewtopic.php?t=23440
There could be a class like RayCastUtilities or something that just does this. This wiki snippet here
http://www.ogre3d.org/wiki/index.php/Ra ... ygon_level should just be officially included in the OGRE library, it doens't hurt to add one of this feature but it will save a lot of users spending time from customizing this wiki to fit their code.
I can't find any valid reason why this won't be included or not part of a design if it can be added as an extra utility function.
Re: accurate object picking
Posted: Wed Jan 21, 2009 7:21 am
by jacmoe
It is not going to be added, ever.

It might seem innocent right now, but it will get out of hand.
Addon utilities are provided as addons. Mostly by the community.
Like the
MOC.
Re: accurate object picking
Posted: Wed Jan 21, 2009 5:51 pm
by KungFooMasta
As jacmoe pointed out, it does seem there is great resistance to growing the code base. In this aspect, I am very interested in watching the evolution of Ogre.
Re: accurate object picking
Posted: Wed Jan 21, 2009 6:06 pm
by sinbad
Efficient ray/triangle tests are best done with something like Opcode. There's really no point us duplicating this functionality, and there have been examples of using it in the past. MOC is nice for those that want something quick and dirty, but I really don't want to advocate that approach in the core.
And who says you always use ray picking anyway? In actual fact when I do per-pixel picking I often use a selection buffer (particularly for GUI tools) - ie a render target using special materials that colour-code objects, then I read a pixel colour back. However, I don't do this generically, it depends on the project - the colour codes may be assigned to groups of objects for example, or be associated with structures in the higher-level application rather than raw Renderable level, or certain objects will be tagged with a context which affects which ones will be visible in the selection buffer. I haven't come across a completely generic approach yet, so I use whichever one fits the project the best.
IMO there are already enough tools in the box to do this, and to pick an approach suitable for your project. Folding all of them into the core will just bloat the code more. Feel free to start an add-on project which wraps them all in a friendly (static) library though for those who want a shortcut.