[Why is it that the most apparently simple tasks ultimately turn out to be the most difficult? Bah.]

So, I decided to create a PQ torus knot using LWJGL based on

this article. Everything is going well until I attempt to orient my circle using the Frenet Frame I've created. (Erm, this will most likely make more sense if you skim the article, sorry). I'm certain that the Frenet Frame is NOT at fault, because

everything looks alright. I assume that there's a problem with my orientation code, which looks like this:

1 2 3 4 5 6
| foreach point_on_circle x = cos(theta) + toruspoint.x y = sin(theta) + toruspoint.y Vector point = [x * N.x, x * N.y, x * N.z] + [y * B.x, y * B.y, y * B.z] end for |

(Where N and B are the two vectors of the Frenet Frame). The article says "newPoint = point.x * N + point.y * B" and as far as I can tell my code does that, but surprise, surprise, what I get looks nothing like it should. I have no idea where to go from here.

I've avoided actually posting the entire code up, because frankly its ugly and inefficient. However, if you need it to diagnose the problem I'll clean it up a bit and post it.

Thanks in advance!

- Eric