Raycaster only works on the first triangle of the BufferGeometry
See original GitHub issueDescription of the problem
I have textured quads built using BufferGeometry with 4 vertices. It is in fact rendered using rasterMesh.drawMode = THREE.TriangleFanDrawMode.
Three.js version
- r79
- r81
- Dev
Browser
- All of them
- Chrome
- Firefox
- Internet Explorer
OS
- All of them
- Windows
- Linux
- Android
- IOS
Hardware Requirements (graphics card, VR Device, …)
Issue Analytics
- State:
- Created 7 years ago
- Comments:40 (4 by maintainers)
Top Results From Across the Web
How to get intersected face when raycasting against buffer ...
Did I get it correctly, that first, you find a face index of a buffer geometry, and then you convert that geometry into...
Read more >Raycaster#intersectObjects – three.js docs
This class is designed to assist with raycasting. Raycasting is used for mouse picking (working out what objects in the 3d space the...
Read more >What object3D properties are required to make rayCaster ...
I am calling raycaster.intersectObjects(myObjects) on this list of original Object3D's. I'm wondering what properties are required for this ...
Read more >Three.js Picking
Probably the most common way of picking is by doing raycasting which means to ... If your scene has 1000 objects and each...
Read more >npm:three-mesh-bvh - Skypack.dev
BufferGeometry.prototype.disposeBoundsTree = disposeBoundsTree; THREE.Mesh.prototype.raycast = acceleratedRaycast; // Generate geometry and ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

glTF allows triangle strips, how is three.js not allowing triangle strips “pigeon-holing”?
@Dmarcoux111 that a feature exists in WebGL is not a sufficient argument. We maintainers have to deal with feature requests and bug reports or supposed bug reports (why does ____ not work?) that consume our time. Every time someone reports that raycasting doesn’t work, or skinning is broken, we have to investigate why that is. Maintaining and debugging code paths for different draw modes cost us time and energy that could be spent on other things, and especially when features don’t work in all cases, we get more bug reports.
If you’d like to share specific performance numbers about why triangle strips are really better for your application, that would be a better line of argument than saying we have to maintain abstractions for this just because it exists in WebGL.
Some more thoughts about this topic:
In context of lines, we have
Line,LineLoopandLineSegmentswhich implicitly encode the draw mode and other primitive specific information (e.g line distances).In
Mesh, we just have adrawModeproperty instead. So the current design was never consistent. It would be if there were something likeTriangleMesh,TriangleFanMeshandTriangleStripMesh. But I don’t think it’s beneficial to have such classes.