RayIntersectMesh - Would this be possible?

Hello, the wonderful community of gamma users and devvvvs,

First of all, I want to share my excitement for this new gamma release.

In the beginning, I was a bit skeptical about this new visual language,
but now, also attending the NODE Festival, I’ve to admit that this oop approach is so powerful and I can’t go back.

Straight to the point: I cannot find any RayIntersectMesh method in the gamma nor the stride repository. How can I achieve a functionality similar to Intersect(EX9 Geometry mesh) or the dx11 version?

Given a Ray and a geometry, know which mesh subset the ray is intersecting.

I am also interested in this topic. I will be waiting for the masters here to guide us some solutions, but I do have some idea for brain storming. Is it possible to change the mesh to SDF first, then check the intersection via raymarching? Elias’s workshop (Turning a .NET library into a VL library) in Node20 had demonstrated that how mesh was changed to sdf.

Btw, I have found a category off Physics under Stride in the experimental nodes …

Hi Neuston, I’ll look in SDF, but it seems complicated an maybe heavy for calculation.

All the nodes RayIntersect…Something comes with stride in the preview version. All except the one i’m looking for and I’m not sure it would be easy to implement.

It seem that is not possible in stride. Can anyone confirm?

Looking in

There’s no method for intersecting a mesh. I’m also trying to understand how Stride manages subsets.
There’s an toggle merge meshes on File Model (Stride.Asset) node, but i did not manage to split not identify the subsets.

I’ll investigate more.

Suspect that it’s done on something like collision layer, and you need a collision mesh around it…

https://doc.stride3d.net/latest/en/manual/physics/raycasting.html

1 Like

Yes, antokhio is right, what you are looking for is raycasting. Unfortunately we didn’t have time to make the nodes for that yet.

What you can do if you need that now is creating a mesh collider in game studio, import it with the Asset node and reference the Stride.Physics.dll to get the raycasting methods.

See the last section of this video:

If you are looking for entity picking in the scene, like in 3d editors, that works a little bit different. The scene gets rendered with the same camera and a unique color for reach entity into an offscreen texture. Then your get the pixel that the mouse hovers and decode the entity id from that. This will soon be available in VL.Stride, we can use the same code as the game studio is uses.

3 Likes

Thanks, @antokhio, Thanks @tonfilm !!!
I was taking the time to understand what you said…
Unfortunately, I did not understand completely, I need to study, I need more time. :)

I don’t know if I need an entity picking system, but…

What I would like to replicate, is that simple and effective interaction with subset mesh I get used to with Intersect(EX9.Geometry Mesh) or with the newer dx11 implementation by evvvvil.

I’m using Kinect hand tracking to orient a ray and hit the subset meshes coming from Collada Mesh.
If I can’t access to mesh subset and split into entities, it’s ok for me to export meshes one by one.

This week I’ll be trying all different approaches in VVVV gamma; if I won’t succeed, I’ll stick with VVVVbeta for this demo, but I don’t want to give up, 'cause I’m really loving gamma. This could be The new VVVVenaissance for me…

If anyone can help me and guide me to what I need to study and understand, thanks!

Help > stride > HowTo Intersect Mouse with a Primitive ?

Yes, exactly that, but not with a primitive; I need to do it with a custom mesh/meshes.

I started looking into that patch at the beginning and then figured out that in stride, maybe for performance optimization, all the collision helpers are primitive and there’s no straight way to do this like in vvvv beta with the intersect node…

Well just spend a hour trying to make it work but it seems there should be something called “Simulation” exposed and it isn’t, without it i doubt that’s possible…

@antokhio. Thanks for the participation! I’m guessing that in stride this stuff is different from dx9/dx11

I’ll look into dx11 shaders to better understand. I also installed Stride Engine to have a look at collision mesh and related.

Thanks again. I really appreciate.

All right 1 hour more https://www.youtube.com/watch?v=-oZLSKfcluM&feature=youtu.be&ab_channel=antokhio

Git repo https://github.com/antokhio/StrideCollider1

6 Likes

Thanks a lot @antokhio!! Your commitment was unreal. And the results are exciting. Anyway this raycast subject is very complicated and I’ve to bend my mind to understand it.

Thanks for the tutorial. I did everything you pointed in the video starting from an empty patch and it works. I’ll keep you updated as I go foward.

Bye

thanks a lot for the video, it explains everything right, only the part of retrieving the entity can be improved on. i’v made an update to the patch and it should be easier to understand now:

the changes can be found here:

1 Like

Well glad to share some knowledge, looking forward for this stuff to be implemented on the main lib

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.

a minimally modified Raycast node is now included as experimental with 5.3-preview
thanks again for digging through this @antokhio

and here a transcription of the necessary steps to take in game studio to make a collider shape assigned to a model (as outlined in the video):

  1. add asset > model > 3d model: choose file
    • no textures, no material, no skeleton
  2. add asset > scene
  3. drag Scene to MainScene
  4. drag model to Scene
  5. add assets > physics > convex hull
    • choose the importet 3d model asset
  6. on the 3d model entity > add component > physics > static collider
  7. in the component go to Static Collider > Collider Shapes → add asset
    • drag the Collider Shape (created in step 5) in
    • this now may take a while: note the “Loading assets…” info flashing above the editor window!
  8. to view the collider shape enable “Physics” in the editors “Grid and Gizmo” options
  9. to refine the collider shape, select it then activate “Decomposition” → this takes time depending on your model and used parameters
4 Likes