I have an object with which I would like to follow a bezier curve, and am losing a little now, how to make it do it based on time, not the points that make up the curve.
. :: Current system ::. Each object on my scene graph is made up of position, rotation, and scale vectors. These vectors are used to form the corresponding matrices: scale, rotation, and translation. Which are then multiplied in order to form a local transformation matrix. The world transformation (usually the identity matrix) is then multiplied by the local matrix transformation.
class CObject
{
public:
Matrix4f GetLocalTransform() const;
void SetPosition(const Vector3f& pos);
void SetRotation(const Vector3f& rot);
void SetScale(const Vector3f& scale);
Matrix4f m_local;
Vector3f m_localPostion;
Vector3f m_localRotation;
Vector3f m_localScale;
}
Matrix4f CObject::GetLocalTransform()
{
Matrix4f out(Matrix4f::IDENTITY);
Matrix4f scale(), rotation(), translation();
scale.SetScale(m_localScale);
rotation.SetRotationDegrees(m_localRotation);
translation.SetTranslation(m_localTranslation);
out = scale * rotation * translation;
}
The big question I have is
1) How to orient my object tangent to the Bezier curve?
2) , ?
void CNodeControllerPieceWise::AnimateNode(CObject* pSpatial, double deltaTime)
{
Vector3f posDelta = pSpatial->GetWorldTransform().GetTranslation();
Vector3f pos = curve.GetPosition(m_t);
Vector3f tangent = curve.GetFirstDerivative(m_t);
}
: , . , .
, .
, , , , , .