PDA

View Full Version : I have a Spline curve,How could I Generate a 3D tube base on this curve?

Benjamin
04-19-2005, 03:31 PM
I have a Spline curve,How could I Generate a 3D tube base on this curve?

this have struggle me some days. I want to build a 3D curve-tube which is shaped by a smooth curve.

give me a help,thanks a lot!

Java Cool Dude
04-19-2005, 05:09 PM
Man it is gonna take me a while to explain this...God please have mercy on my soul, Amen.
OK buddy here we go (All theory, I just thought of it)

Take your current point Pc at tk = t0 + k and another point Pn tk+1 = tk + some amount alpha that depends on how smooth you want your tunnel.

Ok let's call V the vector made by subtracting Pc from Pn and then normalizing it, therefore V = normalize(Pn - Pc).

What we're gonna do now is create a set of points equally distant from Pc and laying on the plane where V is the normal vector and Pc a point on that plane.
....
....
Let me put a demo together and get back to you, I really don't feel too enthusiastic about writting a lot of stuff at once :p

Benjamin
04-19-2005, 08:56 PM
Thanks "Java Cool Dude" very much.

your method is right,but still have mamy detail I can resolve.
can you send me a Demo?My Email :
huawenguang@sina.com

Ido_Ilan
04-19-2005, 09:14 PM
Hi,

Java Cool Dude, if you prepare a demo could you please put it on a public share? :D

Thanks
Ido

Java Cool Dude
04-19-2005, 09:23 PM
Oh you guys will love it, just wait :D

Java Cool Dude
04-20-2005, 01:04 PM
http://www.realityflux.com/abba/Pictures/Dev%20Pics/screenShot044.jpg
Coming soon, I still have few things to improve :p

yooyo
04-20-2005, 01:16 PM
http://linas.org/gle/index.html

yooyo

Java Cool Dude
04-20-2005, 05:22 PM
Sorry this demo turned out to be less impressive than I promised; I really am tight on free time these days :(
Screen (http://www.realityflux.com/abba/C++/Procedural%20Spline%20Tube/splineTube.jpg)
Binaries (http://www.realityflux.com/abba/C++/Procedural%20Spline%20Tube/ProceduralSplineTube.zip)
Source (http://www.realityflux.com/abba/C++/Procedural%20Spline%20Tube/ProceduralSplineTubeSRC.zip)
Engine source (http://www.realityflux.com/abba/C++/SXMLEngine/SXMLEngine.zip)

Ido_Ilan
04-20-2005, 08:49 PM
Java Cool Dude, Very nice job.
I like it :D .
Thanks for sharing :)

sqrt[-1]
04-20-2005, 09:53 PM
Have a look at:
http://www.blackpawn.com/texts/pqtorus/default.html

This was the basis of a old unreleased cg shader entry of mine. (where a fixed vertex buffer tube was stretched to plot along a entered maths equation -like a PQ torus knot)

Benjamin
04-21-2005, 12:03 AM
Java cool Dude,very kind of you!excellent job. :D

Thanks YooYo,sqrt[-1].

Java Cool Dude
04-21-2005, 01:17 AM
Oh you're very welcome :D

knackered
04-21-2005, 02:51 AM
Ah it's all starting to come together now...JavaCoolDude is also known as AbbaZabba from the nvnews forum.
The same fella who did these lovely demos using FBO:-

Good work, JavaCoolDude...and these are all in java?

Java Cool Dude
04-21-2005, 06:55 AM
Nah dude, it's been a long time since I wrote anythnig in Java, here's a link to some of the demos written back then:
http://xith.org/demo/JavaCoolDude.php

SirKnight
04-21-2005, 04:03 PM
Well Java Cool Dude is a regular demo dynamo. ;)

I wonder how similar this method is to the one Quake 3 uses to generate bezier pipes.

-SirKnight

Benjamin
04-21-2005, 04:20 PM
hi,Java Cool Dude,I have seen your old Demos too.That's great.