Can anybody tell me the proper way to intersect a ray with a piece of geometry. I have been able to create the geometry but how am I supposed to get the hit information from intersection? What are the primitive IDs in Ray and why are there 2 of them?
Please read the API section in readme.pdf and have a look into tutorial00. The scene consists of geometries (e.g. triangle meshes), each having multiple primitives (e.g. triangles). The geomID is the identifier of the hit geometry, and the primID the identifier of the hit primitive inside this geometry.
Please read the subject of this thread: I am looking for help with Embree 2.0. If there is a "readme.pdf" for 2.0 I would be glad to have it. I have been looking for it for quite some time now and somehow its magically non-existent. Anyway the Ray in Embree 2.0 does not have geomID and primID, instead has id0 and id1 but I don't think they are equivalent because in 2.0 there is no concept of intersecting with a full scene but only to the geometry - so a geomID equivalent would be redundant. So if you have any idea how I can interpret id0, id1 etc. other hit information then please let me know.
When creating a triangle mesh in Embree 2.0, you specify id0 and id1 for each triangle (see tutorrial00). These IDs are returned in the i0 and id1 fields of the ray after intersecting with the scene.
Thanks Sven, this helps. Another thing, how do I use the barycentric coordinates (u, v) which are returned in the Ray after hit?
On a separate note, since 2.0 does not have a concept of a scene as in 2.3, is it possible to create multiple object into one triangle mesh and treat it as the scene? For example, if there is a scene which consists of a cube and a ball (mutually disjoint), then can I create 1 mesh which contains both these objects and then intersect it with the ray?