# Raycaster: BufferGeometry with new Face3

**URL:** https://discourse.threejs.org/t/raycaster-buffergeometry-with-new-face3/1399
**Category:** Questions
**Tags:** raycaster, buffergeometry
**Created:** [December 13, 2017, 4:31pm UTC](https://discourse.threejs.org/t/raycaster-buffergeometry-with-new-face3/1399 "2017-12-13T16:31:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![hofk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/hofk/32/44944_2.png) [@hofk](https://discourse.threejs.org/u/hofk)
#### Post date: [December 13, 2017, 4:31pm UTC](https://discourse.threejs.org/t/raycaster-buffergeometry-with-new-face3/1399/1 "2017-12-13T16:31:39Z")

</div>

I did some tests with Raycaster and indexedBufferGeometry.

According to the documentation

* * *

_Raycaster .intersectObject_  
[https://threejs.org/docs/index.html#api/core/Raycaster.intersectObject](https://threejs.org/docs/index.html#api/core/Raycaster.intersectObject)

_faceIndex – index of the intersected face_  
_indices – indices of vertices comprising the intersected face_

_When intersecting a Mesh with a BufferGeometry, the faceIndex will be undefined, and indices will be set; when intersecting a Mesh with a Geometry, indices will be undefined._

* * *

I have created output.

That was correct except for the indices.

![20171213-1509-50726](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/1X/9b395b0e63613b6f1dc7b481276b6bd72c6456e4.png)

In the source code  
_three.js/src/objects/Mesh.js (github .com /mrdoob/three.js/blob/master/src/objects/Mesh.js)_  
I found:

function checkBufferGeometryIntersection( …  
if ( intersection ) {…  
intersection.face = new Face3( a, b, c, Triangle.normal( vA, vB, vC ) );  
intersection. **faceIndex** = a;

Then I took **faceIndex** and it works.

![20171213-1515-50157](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/1X/cee66b000dd8b72b5fb246f311adc5499866a5be.png)

Addendum: A more complete edition:

![20171213-2040-04675](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/1X/e860ce90b2bf8b8f1d2318bad9408bf1c8918ccc.png)

BufferGeometry and Face3 ❓  
_I’m a little confused. 🤔 How do I get clear in my head again?_

---

<div class="post-metadata">

### Author: ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)
#### Post date: [December 13, 2017, 8:06pm UTC](https://discourse.threejs.org/t/raycaster-buffergeometry-with-new-face3/1399/2 "2017-12-13T20:06:57Z")

</div>

Looks like the docs are not correct. `indices` is no property of an intersection object. `face` and `faceIndex` should always contain valid data.

---

<div class="post-metadata">

### Author: ![hofk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/hofk/32/44944_2.png) [@hofk](https://discourse.threejs.org/u/hofk)
#### Post date: [December 13, 2017, 8:30pm UTC](https://discourse.threejs.org/t/raycaster-buffergeometry-with-new-face3/1399/3 "2017-12-13T20:30:05Z")

</div>

OK, I understand.

Is it safe to assume that Face 3 is on the spot

_intersection. face = new Face3 (a, b, c, triangle. normal (vA, vB, vC);_

will endured?

I thought Face3 was designed for Geometry.

---

<div class="post-metadata">

### Author: ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)
#### Post date: [December 13, 2017, 9:42pm UTC](https://discourse.threejs.org/t/raycaster-buffergeometry-with-new-face3/1399/4 "2017-12-13T21:42:05Z")

</div>

> I thought Face3 was designed for Geometry.

As you can see in the code, it is also used a general data structure for face information. And yes, i don’t think we will change this in the near future 😉

BTW: We should definitely correct the docs to clarify the situation.
