#### Archived

This topic is now archived and is closed to further replies.

# 3 math questions

This topic is 5461 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello, I am working on a game (http://www.sourceforge.net/projects/capturetf/) and I have some questions. How can I: 1) Find the tangent to a cubic spline (the camera moves along a spline in the main menu and I want it to look the direction it moves) 2) Mirror a quaternion around an axis (the artists want to only make half the skeleton and have a program mirror it, each bone''s orientation is represented with a quaternion) 3) Interpolate between quaternions (for skeletal animation) Any answers you have or resources you can point me to would be very helpful.

##### Share on other sites
1. If I remember correctly, there are a set of basis functions corresponding to the derivatives of the primary basis functions that, when multiplied by your control points, give you the tangent at u. In my Bezier patch class, I used this method to calculate the normals, as the cross product of the two tangents at u,v.

Unfortunately, I don''t remember the formulas and don''t know where that code is :-( But abstractly, I think that''s how you would do it.

2. Not quite sure. Perhaps you could extract the angle/axis, mirror that, and construct a new quaternion from that?

3. What you want is slerp, or ''spherical linear interpolation'', which interpolates smoothly between two quaternions along the surface of the 4D unit sphere. The algorithm is described in, among other places, ''3D Math Primer'' and, I believe, ''Game Programming Gems 1''.

1. 1
Rutin
46
2. 2
3. 3
4. 4
5. 5
JoeJ
19

• 11
• 15
• 9
• 10
• 13
• ### Forum Statistics

• Total Topics
633004
• Total Posts
3009837
• ### Who's Online (See full list)

There are no registered users currently online

×