There's many answers to this problem, but I'm not sure that they all work with XTK, such as seeing multiple answers for this in Three.JS, but of course XTK and Three.JS don't have the same API obviously. Using a ray and Matrix
seemed very similar to many other solutions for other frameworks, but I'm still not grasping a possible solution here. For now just finding the coordinates X, Y, and Z and recording them into Console.Log
is fine, later I was hoping to create a caption/tooltip to display the information, but there is other ways to display it also. But can someone at least tell me if this is possible to use a ray to collide with the objects? I'm not sure how collision works in XTK with meshes or any other files. Any hints right now would be great!!
相关问题
- Othographic Projection in XTK
- Finding world coordinates from screen coordinates
- Load volume in xtk without initializing a renderer
- Change the 'config' attribute of an intera
- Is there a way to use a Custom cross-sectional sli
相关文章
- Othographic Projection in XTK
- Finding world coordinates from screen coordinates
- 有没有办法使用3D图像数据的自定义横截面切片的方法吗?(Is there a way to use
- Load volume in xtk without initializing a renderer
- Change the 'config' attribute of an intera
- Is there a way to use a Custom cross-sectional sli
- How to change a pixel value in XTK
- Wrong volume bounding box
Here is my function to unproject in xtk. Please tell me if you see mistakes. Now with the resulting point and the camera position I should be able to find my intersections. To make the computation faster for the following step, I'll call it in a pick event and so I'll only have to try the intersections with a given object. If I've time i'll also try with testing the bounding boxes.
Nota bene : the last lines are not required, I could work on the ray instead of the point.
Edit
Here, in my repo, you can find functions in camera3D.js and renderer3D.js for efficient 3D picking in xtk.
right now this is not easily possible. I guess you could grab the view matrix of the camera to calculate the position. If you do so, it would be great to bring it back into XTK as built-in functionality!
Currently, only object picking is possible like this (r is a X.renderer3D):