Hi,
I have seen getRayTo function within Demos, but it appears like imprecise, at least on my iPhone simulator with small objects. I am using OpenGL ES 2, everything is shader based and am using Bullet's vector, and Sony's matrix libraries. I have tried gluUnproject code from Mesa and other sources, and confirmed my gluUnproject is producing exactly the same results as the one on OpenGL fixed pipeline. Nevertheless, it does not seem usable with Bullet anyway. I have read a few things about ray casting and it appears like precision may require some more processing power (actually, a more complicated algorithm which I have no idea about).
I would be very happy, if somebody could point me, at least, a good source describing how "picking" in Bullet works and/or how can I perform ray cast precisely with Bullet.
Thanks!
How to pick (hit) objects precisely?
-
- Posts: 2
- Joined: Sat Jan 08, 2011 6:24 pm
Re: How to pick (hit) objects precisely?
The screen location of a touch is slightly above the physical location of a touch.
This offset is the result of user testing at Apple (see Stanfords iTuneU video on touches).
This may or may not bear on your problem at all, but as this 'inaccuracy' sometimes irritates me during precise picking on an actual device it might be relevant.
This offset is the result of user testing at Apple (see Stanfords iTuneU video on touches).
This may or may not bear on your problem at all, but as this 'inaccuracy' sometimes irritates me during precise picking on an actual device it might be relevant.
-
- Posts: 43
- Joined: Mon Jan 03, 2011 4:26 pm
Re: How to pick (hit) objects precisely?
When you say "imprecise", you mean you have a lot of small objects, and sometimes it appears to pick the wrong one? If the objects are smaller than your finger, does it at least pick one that's under where you touched?
I don't use getRayTo, so I'm not sure what it does. The key function call that I use is to btCollisionWorld::rayTest (fromVector, toVector, rayResult &)
It is also possible that your application has a much different graphical representation from Bullet's physical representation, such as a concave object modeled as a convex hull.
I don't use getRayTo, so I'm not sure what it does. The key function call that I use is to btCollisionWorld::rayTest (fromVector, toVector, rayResult &)
It is also possible that your application has a much different graphical representation from Bullet's physical representation, such as a concave object modeled as a convex hull.