Wanted to try building a raycast node since there's no built-in node yet. I have constructed an ultra simple graph for now that raycasts a single point onto a target mesh from a source mesh. The hit point turns red if its outside the mesh.
Used this excellent resource for the math. I have attached a WIP graph if you want to test it yourself. Please remove the .txt extension as the maya board does not seem to allow json files (should probably be chnaged). Note that I have used the rebel pack for some compounds. I will be working on making this more generalized next and to make it work with more points and eventually mesh objects.
Cheers,
Sachin
Cool stuff!
That's some pretty incredible work, really awesome to see! If it worked with strands too, that'd be amazing - maybe I'll try to do that, I love projects like this 😄
I know @sachinshrestha already knows this, but for everyone else we do absolutely intend to have a full suite of spatial queries like raycast, closest points, etc.. but it's great to see how inventive and self-sufficient people are.
I'll get the issue with inability to attach .json files logged.
Thanks @jonah.friedman! Its a lot of fun to solve some of these problems visually in bifrost. Re this working with strands, here is a simple example of a ray line intersection where the line is a strand with just a start point and end point. Of course, this is as simple as it gets. Getting this to work on a non straight strand made of up multiple line segments would be my next attempt. The graph is a bit mucky so not sharing it right now but should be easy to rebuild if one follows numerous examples online for this problem. I followed this specific example.
On an unrelated note, I noticed that the bifrost viewport was not getting updated correctly when the anti-aliasing was on. I had to always tumble or pan around to see the updated results. So I had to turn that off when screen grabbing this gif.
Cheers,
Sachin
Glad to hear it's fun 🙂
Please post the scene file that reproduces the viewport not updating with AA issue, I have not seen that one. Also please include what version of Bifrost, Maya, and OS you're suing.
Hi Jonah,
I was unable to reproduce the issue again at my end. Tried a few things and updates seem to work fine right now. Could have an issue with my machine. Just for the record here are the specs:
Maya 2019.2 (Cut ID 201907021615-48e59968a3)
Bifrost 2.0.1.1
CentOS 7.6.1810 (3.10.0-957.5.1.el7.x86_64)
Cheers,
Sachin
Closest point test without using the built-in node.
Cheers,
Sachin
Attaching the scene file. I've cleaned up the node names a bit so it should be hopefully clear on what's going on. Was feeling lazy to turn this into a compound or add backdrops etc. Btw, backdrops seem a bit redundant right now as the nodes they contain can go outside of the backdrop if you were to auto-layout the graph (the L hotkey). I also may have some redundant parts in the graph which I'm sure can be cleaned up or made simpler.
Cheers,
Sachin