Page 1 of 1

I want to know if i'm picking front face or back face

Posted: Mon Aug 07, 2017 10:16 am
by Furya
Hi,

I use Bullet for picking and Ogre3d for rendering. I have 2 Questions:

1) If I have a double-sided plane and if I pick it I want to know if I pick front face or back face. It is possible to do that ?
2) How can I know wich subEntities or SubMesh i am picking ?

thx

++

Re: I want to know if i'm picking front face or back face

Posted: Tue Aug 08, 2017 5:32 pm
by erbisme4@yahoo.com
check the hit normal and take the dot product with the camera. If it's negative it's the side closest to you.

Re: I want to know if i'm picking front face or back face

Posted: Tue Aug 08, 2017 5:39 pm
by erbisme4@yahoo.com
Also the ClosestRayResultCallback will always yield the front plane if I'm correct.

Re: I want to know if i'm picking front face or back face

Posted: Wed Aug 09, 2017 9:42 pm
by Furya
Ok thanks i will do that..

And do you have an idea about my second question ?

if I have severeal subEntities or SubMesh how can I know wich subEntities or SubMesh i am picking ?

Re: I want to know if i'm picking front face or back face

Posted: Thu Aug 10, 2017 2:06 pm
by erbisme4@yahoo.com
I'm not sure what you mean. btTriangleIndexVertexArray::addIndexedMesh ? A pool of vertices with child meshes? What exact bullet structure are you talking about?