• Welcome to Dark Bit Factory & Gravity.
 

PQ Torus Knot

Started by evobyte, September 02, 2010

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

evobyte

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!

hellfire

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.
Challenge Trophies Won:

evobyte

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...  ::)

relsoft

Challenge Trophies Won:

evobyte

#4
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

Jim

Cool stuff!

btw, You can give karma once you hit 25 posts.

Jim
Challenge Trophies Won: