.\" Automatically generated by Pandoc 3.1.11.1 .\" .TH "RTC_GEOMETRY_TYPE_QUAD" "3" "" "" "Embree Ray Tracing Kernels 4" .SS NAME .IP .EX RTC_GEOMETRY_TYPE_QUAD \- quad geometry type .EE .SS SYNOPSIS .IP .EX #include RTCGeometry geometry = rtcNewGeometry(device, RTC_GEOMETRY_TYPE_QUAD); .EE .SS DESCRIPTION Quad meshes are created by passing \f[CR]RTC_GEOMETRY_TYPE_QUAD\f[R] to the \f[CR]rtcNewGeometry\f[R] function call. The quad indices can be specified by setting an index buffer (\f[CR]RTC_BUFFER_TYPE_INDEX\f[R] type) and the quad vertices by setting a vertex buffer (\f[CR]RTC_BUFFER_TYPE_VERTEX\f[R] type). See \f[CR]rtcSetGeometryBuffer\f[R] and \f[CR]rtcSetSharedGeometryBuffer\f[R] for more details on how to set buffers. The index buffer contains an array of four 32\-bit indices per quad (\f[CR]RTC_FORMAT_UINT4\f[R] format), and the number of primitives is inferred from the size of that buffer. The vertex buffer contains an array of single precision \f[CR]x\f[R], \f[CR]y\f[R], \f[CR]z\f[R] floating point coordinates (\f[CR]RTC_FORMAT_FLOAT3\f[R] format), and the number of vertices is inferred from the size of that buffer. The vertex buffer can be at most 16 GB large. .PP A quad is internally handled as a pair of two triangles \f[CR]v0,v1,v3\f[R] and \f[CR]v2,v3,v1\f[R], with the \f[CR]u\[aq]\f[R]/\f[CR]v\[aq]\f[R] coordinates of the second triangle corrected by \f[CR]u = 1\-u\[aq]\f[R] and \f[CR]v = 1\-v\[aq]\f[R] to produce a quad parametrization where \f[CR]u\f[R] and \f[CR]v\f[R] are in the range 0 to 1. Thus the parametrization of a quad uses the first vertex \f[CR]p0\f[R] as base point, and the vector \f[CR]p1 \- p0\f[R] as \f[CR]u\f[R]\-direction, and \f[CR]p3 \- p0\f[R] as v\-direction. Thus vertex attributes \f[CR]t0,t1,t2,t3\f[R] can be bilinearly interpolated over the quadrilateral the following way: .IP .EX t_uv = (1\-v)((1\-u)*t0 + u*t1) + v*((1\-u)*t3 + u*t2) .EE .PP Mixed triangle/quad meshes are supported by encoding a triangle as a quad, which can be achieved by replicating the last triangle vertex (\f[CR]v0,v1,v2\f[R] \-> \f[CR]v0,v1,v2,v2\f[R]). This way the second triangle is a line (which can never get hit), and the parametrization of the first triangle is compatible with the standard triangle parametrization. .PP A quad whose vertices are laid out counter\-clockwise has its geometry normal pointing upwards outside the front face, like illustrated in the following picture. .IP .EX .EE .PP For multi\-segment motion blur, the number of time steps must be first specified using the \f[CR]rtcSetGeometryTimeStepCount\f[R] call. Then a vertex buffer for each time step can be set using different buffer slots, and all these buffers must have the same stride and size. .SS EXIT STATUS On failure \f[CR]NULL\f[R] is returned and an error code is set that can be queried using \f[CR]rtcGetDeviceError\f[R]. .SS SEE ALSO [rtcNewGeometry]