LinePick
BlitzMax Forums/MiniB3D Module/LinePick
| ||
I'm doing a linepick from EntityXYZ of one mesh to EntityXYZ of another. They are simply scaled cubes. I set the entitypickmode after scaling. I've tried EntityPickModes 1,2 and 3. The first problem I encountered was that the line was picking the "from" entity. So I set its EntityPickMode to 0 before the linepick and reset it after. However, with EntityPickModes 1 and 3 the linepick now returns null. When set to 2 i seem to get strange results where it picks the wrong target. |
| ||
I'm doing a linepick from A to B (EntityPickMode,2). I've used CameraProject to draw the line. I set the color of the Entity returned from LinePick to Green. As you can see the LinePick is returning Entity C. What am I doing wrong? ![]() |
| ||
Doh! I was using the absolute co-ords of the second entity, not the offset from the first! Crisis over. :D |
| ||
Is that a football/soccer field? |
| ||
Yes. Here's a slightly be view... ![]() |
| ||
Any ideas why EntityPickModes 1 and 3 (Sphere and Box) don't work on my entities? The Polygon mode is fine but terribly slow when using complex meshes. I've tried setting EntityRadius and EntityBox but no joy. |
| ||
Don't forget to use CreateOctree wish meshes to speed up picking. Not sure why 1 + 3 don't work - they work in the CameraPick example. I'll take a look. |
| ||
Hmm, I tried CreateOctree, but that stopped my linepick working completely. Could max_polys and max_levels affect it? I tried the suggested values "200,5 for large meshes and 0,1 for small meshes". |
| ||
Here's a LinePick example. Put it in the same folder as the CameraPick example. Seems to suggest everything is working OK (including CreateOctree): |
| ||
Must be something with my code then. Thanks Simon. |