1 Attachment(s)
3D Tubes: Knot and spiral with physics
i will post the code even it is still in spaghetti mode.
to make a 3D tube, we plot the one dimensional curve point by point then we use frenet frame to extrude points from every point so it form a circle and after many circles (Bands) we connect the points with triangles, look:
http://www.dbfinteractive.com/forum/...p?topic=5993.0
download everything needed to run the 2 examples (code + xors3D dlls + pictures all in one folder) from here:
https://www.mediafire.com/?ffbt3ahu0docy8p
included:
1- 3D knot from tube, with concave physical body, and a sphere run inside it
2- spiral from tube
you need the DirectX 9 installed in your machine
http://download.microsoft.com/downlo...010_redist.exe
Tested in windows xp/32
Attachment 9707
EDIT: to close the knot (approx) replace:
While angle <= 2*Pi - 0.1
with:
While angle <= 2*Pi