1RTC_GEOMETRY_TYPE_TRIANGLEE(m3b)ree Ray Tracing KernelRsTC3_GEOMETRY_TYPE_TRIANGLE(3)
2
3
4
5 NAME
6 RTC_GEOMETRY_TYPE_TRIANGLE - triangle geometry type
7
8 SYNOPSIS
9 #include <embree3/rtcore.h>
10
11 RTCGeometry geometry =
12 rtcNewGeometry(device, RTC_GEOMETRY_TYPE_TRIANGLE);
13
14 DESCRIPTION
15 Triangle meshes are created by passing RTC_GEOMETRY_TYPE_TRIANGLE to
16 the rtcNewGeometry function call. The triangle indices can be speci‐
17 fied by setting an index buffer (RTC_BUFFER_TYPE_INDEX type) and the
18 triangle vertices by setting a vertex buffer (RTC_BUFFER_TYPE_VERTEX
19 type). See rtcSetGeometryBuffer and rtcSetSharedGeometryBuffer for
20 more details on how to set buffers. The index buffer must contain an
21 array of three 32-bit indices per triangle (RTC_FORMAT_UINT3 format)
22 and the number of primitives is inferred from the size of that buffer.
23 The vertex buffer must contain an array of single precision x, y, z
24 floating point coordinates (RTC_FORMAT_FLOAT3 format), and the number
25 of vertices are inferred from the size of that buffer. The vertex buf‐
26 fer can be at most 16 GB large.
27
28 The parametrization of a triangle uses the first vertex p0 as base
29 point, the vector p1 - p0 as u-direction and the vector p2 - p0 as
30 v-direction. Thus vertex attributes t0,t1,t2 can be linearly interpo‐
31 lated over the triangle the following way:
32
33 t_uv = (1-u-v)*t0 + u*t1 + v*t2
34 = t0 + u*(t1-t0) + v*(t2-t0)
35
36 A triangle whose vertices are laid out counter-clockwise has its geome‐
37 try normal pointing upwards outside the front face, like illustrated in
38 the following picture:
39
40 For multi-segment motion blur, the number of time steps must be first
41 specified using the rtcSetGeometryTimeStepCount call. Then a vertex
42 buffer for each time step can be set using different buffer slots, and
43 all these buffers have to have the same stride and size.
44
45 Also see tutorial [Triangle Geometry] for an example of how to create
46 triangle meshes.
47
48 EXIT STATUS
49 On failure NULL is returned and an error code is set that be get
50 queried using rtcGetDeviceError.
51
52 SEE ALSO
53 [rtcNewGeometry]
54
55
56
57 RTC_GEOMETRY_TYPE_TRIANGLE(3)