So, slowly but sure I'm going mad...
Here an example:
#include <acknex.h>
#include <default.c>
VECTOR* P1={x=1;y=1;z=8;}
VECTOR* P2={x=7;y=4;z=5;}
VECTOR* P3={x=1;y=7;z=7;}
VECTOR* Result;
var Travel_Speed=1;
var Smoothness=1;
function bezier_spline(VECTOR* a, VECTOR* b, VECTOR* c, var Travel_Speed, var Smoothness)
{
VECTOR* Copy_a=nullvector;
vec_set(Copy_a,a);
VECTOR* Copy_b=nullvector;
vec_set(Copy_b,b);
VECTOR* Copy_c=nullvector;
vec_set(Copy_c,c);
VECTOR* vec_a_b=nullvector;
vec_sub(Copy_b,a); //EXCLUDE THIS!!!
return(Copy_c);
}
function main()
{
Result=bezier_spline(P1,P2,P3,1,1);
}
PANEL* Anzeige=
{
digits (10, 10, 5.3, *, 1,Result[0]);
digits (10, 20, 5.3, *, 1,Result[1]);
digits (10, 30, 5.3, *, 1,Result[2]);
flags = VISIBLE;
}
What the hell has the marked line to do with vector Copy_c ????????????
If you exclude/include it the result will change!!!
I don't get it.