Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This answer does not (as far as I see) favor one of the methods you mentioned in your question, but is what I would do in this situation.</p> <p>I would calculate the normalized normal (or binormal) of the curve. Let's say I take the normalized normal and have it as a function of t (<code>N(t)</code>). With this I would write a helper function to calculate the offset point P:</p> <pre><code>P(t, o) = B(t) + o * N(t) </code></pre> <p>Where <code>o</code> means the signed offset of the curve in normal direction.</p> <p>Given this function one would simply calculate the points to the left and right of the curve by:</p> <pre><code>Points = [P(t, -w), P(t, w), P(t + s, -w), P(t + s, w)] </code></pre> <p>Where <code>w</code> is the width of the curve you want to achieve.</p> <p>Then connect these points via two triangles.</p> <p>For use in a triangle strip this would mean the indices:</p> <pre><code>0 1 2 3 </code></pre> <p><strong>Edit</strong></p> <p>To do some work with the curve one would generally calculate the Frenet frame.</p> <p>This is a set of 3 vectors (Tangent, Normal, Binormal) that gives the orientation in a curve at a given parameter value (t).</p> <p>The Frenet frame is given by:</p> <pre><code>unit tangent = B'(t) / || B'(t) || unit binormal = (B'(t) x B''(t)) / || B'(t) x B''(t) || unit normal = unit binormal x unit tangent </code></pre> <p>In this example <code>x</code> denotes the cross product of two vectors and <code>|| v ||</code> means the length (or norm) of the enclosed vector <code>v</code>.</p> <p>As you can see you need the first (<code>B'(t)</code>) and the second (<code>B''(t)</code>) derivative of the curve.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload