THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 10/03/2004 at 16:29, xxxxxxxx wrote:
Cinema 4D Version: 8.206
Language(s) : C++ ;
Im making a plugin that is similiar to the Arrange tool in Cinema4D. My problem is that I can't work out how to orientate the objects properly against the spline.
I'm using the following code to rotate the objects
vTempRot = spline->GetSplineTangent(rPosition,j); m.v3 = Abs(vTempRot); m.v1 = -(vTempRot % m.v2); m.v2 = (vTempRot % m.v1);
This works for about 98% of the time, on some occasions on more complicated splines, the rotation of the objects is wrong (one of the axis will be in the opposite direction).
I have a feeling that I have the code wrong as my 3d math is not that good. Infact most of the code above was trial and error
Can someone shed some light on what I have done wrong?