Hi,
I was checking out some torus knot equations at http://en.wikipedia.org/wiki/Torus_knot. My question is, I've got a per-pixel implementation working based on the formulas given, but I'd like to know how to connect-the-dots, if you will, with triangle strips, to make a solid looking knot. Right now it just looks like a graph or a pencil drawing, not very 3D at all.
[EDIT] I'd like to add that by "solid", I mean drawn such that I could texture map it and apply lighting, etc.
Thanks for any ideas!
The pq-function gives the center-point (x,y,z) of the cylinder for a given angle.
Sampling the function a small step before and after the desired angle gives the orientation of the cylinder.
Create circles around the center and along the orientation and connect neighbouring circles by polygons.
Have a look at Blackpawn's page (http://www.blackpawn.com/texts/pqtorus/default.html).
Alright, it appears that answer is indeed to use a Frenet frame while following along the curve. Thanks for your answer. Time to crack open the old math books... ::)
Code here:
http://rel.betterwebber.com/junk.php?id=41
Very old. Needs SDL.DLL
This is fantastic, Relsoft. Thanks for sharing your code.
If I knew how to give you karma, I would, haha.
[EDIT] Actually your whole site is just amazing. Awesome that you provide code for every example. I bookmarked it, and I will follow along closely with my math book ;-)
Thank you SO much.
-evobyte
Cool stuff!
btw, You can give karma once you hit 25 posts.
Jim