@@ -72,8 +72,10 @@ The curve indices can be specified through an index buffer
7272(\f[ C ] RTC_BUFFER_TYPE_INDEX\f[ ] ) and the curve vertices through a vertex
7373buffer (\f[ C ] RTC_BUFFER_TYPE_VERTEX\f[ ] ).
7474For the Hermite basis a tangent buffer
75- (\f[ C ] RTC_BUFFER_TYPE_TANGENT\f[ ] ) and for normal oriented curves a
76- normal buffer (\f[ C ] RTC_BUFFER_TYPE_NORMAL\f[ ] ) has to get specified
75+ (\f[ C ] RTC_BUFFER_TYPE_TANGENT\f[ ] ), normal oriented curves a normal
76+ buffer (\f[ C ] RTC_BUFFER_TYPE_NORMAL\f[ ] ), and for normal oriented
77+ Hermite curves a normal derivative buffer
78+ (\f[ C ] RTC_BUFFER_TYPE_NORMAL_DERIVATIVE\f[ ] ) has to get specified
7779additionally.
7880See \f[ C ] rtcSetGeometryBuffer\f[ ] and
7981\f[ C ] rtcSetSharedGeometryBuffer\f[ ] for more details on how to set
@@ -150,55 +152,30 @@ By default the tessellation rate is 4.
150152.PP
151153The \f[ C ] RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_*\f[ ] mode is a mode designed
152154to render blades of grass.
153- In this mode the curve is rendered as a flat band whose center exactly
154- follows the provided vertex spline, whose half width approximately
155- follows the provided radius spline, and whose orientation follows the
156- provided normals.
157- For normal oriented curves, the indices point to the first of 2
158- consecutive normals in the normal buffer.
159- The normal of the constructed curve will match the direction of the
160- first normal at the beginning, and the direction of the second normal at
161- the end of the curve.
162- Please note that this layout of the normal buffer is independent of the
163- used basis for the curve itself.
164- For the cubic B\- spline and cubic Hermite basis the stride from the
165- first control vertex of the first and the next segment is typically 1,
166- thus the normal buffer is compact and the curves share the normal at the
167- begin and end.
168- However, for the cubic Bézier basis, the stride is typically 3, thus
169- begin and end normal cannot get shared.
170- We recommend using the Hermite basis instead of the Bézier basis, as it
171- allows a more compact layout.
155+ In this mode a vertex spline has to get specified as for the previous
156+ modes, but additionally a normal spline is required.
157+ If the Hermite basis is used, the \f[ C ] RTC_BUFFER_TYPE_NORMAL\f[ ] and
158+ \f[ C ] RTC_BUFFER_TYPE_NORMAL_DERIVATIVE\f[ ] buffers have both to be set.
159+ .PP
160+ The curve is rendered as a flat band whose center approximately follows
161+ the provided vertex spline, whose half width approximately follows the
162+ provided radius spline, and whose normal orientation approximately
163+ follows the provided normal spline.
172164.PP
173165To intersect the normal oriented curve, we perform a newton\- raphson
174166style intersection of a ray with a tensor product surface of a linear
175167basis (perpendicular to the curve) and cubic Bézier basis (along the
176168curve).
177- We construct the 8 control points of this surface in Bézier basis by
178- calculating a normalized direction \f[ C ] d01=normalize(v1\- v0,n0)\f[ ] and
179- \f[ C ] d23=normalize(v3\- v2,n1)\f[ ] .
180- These directions are perpendicular to the tangent direction of the
181- center curve and first and second specified normal.
182- The 8 control vertices of the surface are constructed as:
183- .IP
184- .nf
185- \f[ C ]
186- \ p00\ =\ v0\- r0*d01,\ p10\ =\ v0+r0*d01
187- \ p01\ =\ v1\- r1*d01,\ p11\ =\ v1+r1*d01
188- \ p02\ =\ v2\- r2*d23,\ p12\ =\ v2+r2*d23
189- \ p03\ =\ v3\- r3*d23,\ p13\ =\ v3+r3*d23
190- \f[ ]
191- .fi
192- .PP
193- The center of this curve exactly follows the specified center spline,
194- the normal at the start (and end) exactly match the fisrst (and second)
195- specified normal, and the half width exactly matches the evaluated
196- radius spline at the start (and end).
197- In\- between the radius and orientation of the curve changes smoothly.
198- Note that the construction does not work when the provided normals are
199- parallel to the curve direction, as then no well defined perpendicular
200- direction \f[ C ] d01\f[ ] or \f[ C ] d23\f[ ] are defined.
201- For this reason thus the provided normals should best be kept as
169+ We use a guide curve and its derivatives to construct the control points
170+ of that surface.
171+ The guide curve is defined by a sweep surface defined by sweeping a line
172+ centered at the vertex spline location along the curve.
173+ At each parameter value the half width of the line matches the radius
174+ spline, and the direction matches the cross product of the normal from
175+ the normal spline and tangent of the vertex spline.
176+ Note that this construction does not work when the provided normals are
177+ parallel to the curve direction.
178+ For this reason the provided normals should best be kept as
202179perpendicular to the curve direction as possible.
203180.PP
204181In the \f[ C ] RTC_GEOMETRY_TYPE_ROUND_*\f[ ] round mode, a real geometric
0 commit comments