Allright, i gave my best so far but i am stuck again.
First thanks again for your explanation. I bet it was good, im just missing some basic knowledge here.
i used the test sketch above to test it first.
but there are serveral things that i am not sure of if i understood them right. the path[i+1]-path[i] looks similar to what i have allready done. But is that how you ment it? taking the segmentpoints and substract them to get the vector?
next thing was calculating TBN. thats looks ok to me.
But how can i use these 3 vectors to rotate the points ?
and rotating using roateX rotateY... doesnt work cause i need coordinates right? so i need to calculate them somehow.
Could you take a look and tell me what i miss or just do wrong...
thank you!
Code:void setup(){
size(400,600,P3D);
}
void draw(){
float x1 = 100;
float y1 = 100;
float z1 = 0;
float x2 = 100;
float y2 = 300;
float z2 = 0;
float x3 = mouseX;
float y3 = mouseY;
float z3 = 0;
background(255);
stroke(0);
line(x1,y1,z1,x2,y2,z2);
line(x2,y2,z2,x3,y3,z3);
PVector T = new PVector(x3-x2,y3-y2,z3-z2);
PVector N = new PVector(x3+x2,y3+y2,z3+z2);
T.normalize();
N.normalize();
PVector B = T.cross(N);
N = B.cross(T);
}