jeske / SimpleScene

Simple 3D scene manager in C# and OpenTK / OpenGL
https://github.com/jeske/SimpleScene/wiki
Other
171 stars 69 forks source link

Question: how to find out which triangle it belongs to for a given vector? #22

Open jiatao99 opened 1 year ago

jiatao99 commented 1 year ago

Thanks for your excellent IcoSphereCreator. After generate this MeshGeometry3D object

  1. Is there any to find out which triangle a vector is inside?
  2. Is there anyway to generate a MeshGeometry3D object where the elevation angle must be larger than a certain angle?
jeske commented 1 year ago

1) What do you mean by "the triangle a vector is inside?" Are you talking about triangle vector intersection? There is code in my BVH asteroid demo that does ray / object / triangle intersection. For small polycount icospheres you can just test every triangle... For large polycount a BVH will make hit testing much faster.

2) elevation angle of what? Typically elevation angle is used to describe the angle from a ground plane to something in the sky i don't understand how this applies to icospheres. Can you clarify?

jiatao99 commented 1 year ago

Thanks for your quick reply.

I am doing a satellite simulation. I want to have a sphere which can be filtered on visible portion on the group (with certain elevation angle). At a given time, I computed the satellite vector, I want to know where the triangle on the sphere it belongs to.