Ray intersecting method on a 3dMesh

imagine the box is an art gallery and the above pictures are for me to place inside the box, i am planning to draw methods from the vvvv gamma drawing example tutorial to place them using cursor clicks and expecting the undo function as well, but the problem is that since iam working with 3d/stride, I need to gain info on the intersection point of box and cursor , so i can place the images there and use its coordinates as a reference elsewhere, i also plan to implement a drag-and-place function for the images inside this box(which i havent figured out yet(second priority)), hope someone can help me.

i looked into “reflect a ray on nearest sphere” example and reached a point where I should ask for help.

@antokhio i saw his video https://www.youtube.com/watch?v=-oZLSKfcluM; that’s a bit too complex for me (i still have no idea on how to get those vector3 points from the intersection) , hope there is a way

Hi, this is already implemented under the Collider category, there is help patch:

Example Random Spheres

What you want is this kind of setup:

e.g. entity should have a ColliderComponent in component, then if you define:

Ray you can perform Raycast like so:

The raycast would then have contact details:

If you look at:

You can find then witch component you are hitting:

random_spheres_raycast.vl (55.9 KB)

You are going to need this ColiderShapeDesc also, witch seems unimplemented, originally it should be a convex hull or something for complex shapes… But maybe you can create a hollow box from boxes…

gallerycollider.zip (7.4 MB)

hi , i tried something, and failed. i ran and read hitpoints from your patch, from your youtube video @antokhio , it was working fine on your model and then i swapped the projectfile(.csproj) of stride with my rectangular box model and it has some errors, i have uploaded my files here, hope you will check. Thank you for your support. very grateful

apparently i was trying using latest version of stride 4.4 but it wasnt working. Then I tried it with stride 4.1.287, and it worked :grinning_face: :grinning_face:

yes, reminder: when using Stride, always make sure to use the version your vvvv version is using, see.