- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
When intersecting with Embree, we get the u and v coordinates of the hit on the geometric shape (a triangle as far as i am concerned).
Many sources will tell that the world coordinate is P1 = V0 * u + V1 * v + V2 * (1-u-v) and others
P2 = V0 * (1-u-v) + V1 * u + V2 * v;
In my scene, it is P2 that is correct and not P1.
How to make sure which one I should use in Embree ? Is P1 always incorrect ?
Thanks for the clarification,
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Embree always uses the second formula (V0 * (1-u-v) + V1 * u + V2 * v) for triangles. Please also see documentation section RTC_GEOMETRY_TYPE_TRIANGLE.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks!
For some reasons I skipped the explanation in the doc.
My ray tracer works beautifully now. +1

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page