21 April, 2010

Using curve 'normal' from PointOnCurveInfo

We can use PointOnCurveInfo node to get information about any point along the given curve. I have been using it for constraining a locator on a curve. It is the same logic used in constraining a transform on a NURBS surface. In this method normal and tangent vectors are used to aim constraint a locator to get the right orientation on the geometry. However, since curve is one dimensional in size, i.e. it has only length and no width, the curve normal tends to swing around when we go pass certain angle. This makes it difficult to use 'normal' vector for aim constraint. We can skip connecting normal vector with up object and just use floating transform or use object rotation axis based on requirement.

2 comments:

  1. Hi Maulik, I´ve faced that problem while ago..
    I´ve tried many things to get a few polyCubes rotations right using tangents/normals on a treadmill curve with this kind of shape:

    o::::::::o

    The traveling cycle worked (I did a mod expression on .parameter for each obj) but the rotations didn´t.. In the end I´ve rebuilt it using motionpaths.

    Best regards,

    ReplyDelete
  2. Hi Renato,
    Yeah that's a good idea to use motion path. It should be possible to get stable normal vectors on a smooth curve. And it seems motion path is doing it right. May be the pointOnCurveInfo is not calculating it right for extreme angles. Would be interesting to look into it.

    ReplyDelete