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

Post Reply
Furya
Posts: 21
Joined: Tue Sep 22, 2015 1:34 pm

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

Post by Furya » Mon Aug 07, 2017 10:16 am

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

++

erbisme4@yahoo.com
Posts: 41
Joined: Fri Apr 29, 2016 2:41 pm

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

Post by erbisme4@yahoo.com » Tue Aug 08, 2017 5:32 pm

check the hit normal and take the dot product with the camera. If it's negative it's the side closest to you.

erbisme4@yahoo.com
Posts: 41
Joined: Fri Apr 29, 2016 2:41 pm

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

Post by erbisme4@yahoo.com » Tue Aug 08, 2017 5:39 pm

Also the ClosestRayResultCallback will always yield the front plane if I'm correct.

Furya
Posts: 21
Joined: Tue Sep 22, 2015 1:34 pm

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

Post by Furya » Wed Aug 09, 2017 9:42 pm

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 ?

erbisme4@yahoo.com
Posts: 41
Joined: Fri Apr 29, 2016 2:41 pm

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

Post by erbisme4@yahoo.com » Thu Aug 10, 2017 2:06 pm

I'm not sure what you mean. btTriangleIndexVertexArray::addIndexedMesh ? A pool of vertices with child meshes? What exact bullet structure are you talking about?

Post Reply