[osg-users] how to draw 3d pipe

2009-06-25 Thread forest
hi all, I know this problem is not so related to OSG, but there is no better place I can find. What I want to draw is to draw a three-dimensional pipe from a 3d curve with a given radius.The "pipe" I mean is alike a cylinder,but it is bent. any ideas? thanks in advance.

[osg-users] How to draw 3D pipe?

2016-07-13 Thread Daven Hem
Dear, Sir I’m Daven Hem in Cambodia. Thanks for your reviewing. We are currently developing new mineral prospecting aided software for local workings. I have to develop 3D VIEWER which can render 3D work place realistic on its screen. On our workings, there are many pipes, including internet, p

Re: [osg-users] how to draw 3d pipe

2009-06-25 Thread Laurent Di Cesare
forest a écrit : hi all, I know this problem is not so related to OSG, but there is no better place I can find. What I want to draw is to draw a three-dimensional pipe from a 3d curve with a given radius.The "pipe" I mean is alike a cylinder,but it is bent. any ideas? thanks

Re: [osg-users] how to draw 3d pipe

2009-06-25 Thread Alberto Luaces
Hi forest, I have done this several times in order to simulate springs. If you have the 3D trajectory, you will also have or you can compute the tangent vector (the one that follows it). For every point in the trajectory, you place a point "r" units away from it and in a perpendicular direction

Re: [osg-users] How to draw 3D pipe?

2016-07-13 Thread Trajce Nikolov NICK
Hi, a)-c) is pretty easy and can be a good task to learn a bit of geometry shaders. I did this long time ago and it was not that hard. Might get you some code if I find it in the email archive. That might helps d) can you clarify more. I have seen this thing with physics and there are companies m

Re: [osg-users] How to draw 3D pipe?

2016-07-13 Thread Chris Hanson
On Wed, Jul 13, 2016 at 10:57 AM, Daven Hem wrote: > We are currently developing new mineral prospecting aided software for > local workings. > I have to develop 3D VIEWER which can render 3D work place realistic on > its screen. > On our workings, there are many pipes, including internet, power,

Re: [osg-users] How to draw 3D pipe?

2016-07-13 Thread Trajce Nikolov NICK
Hi Daven, found the code that might get you started. It uses simple geometry shaders to draw 3D pipeline from a set of points interpolated by catmull rom spline https://groups.google.com/forum/#!topic/osg-users/o8ovoo271lA Havn't checked the code now, but I am sure it will work - it worked then

Re: [osg-users] How to draw 3D pipe?

2016-11-05 Thread Daven Hem
Hi, Trajce Nikolov. Thank you. Your code works surely. Would you let me know how can I set 3D pipe's color? Thank you! Cheers, Daven -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=69243#69243 ___ osg-

Re: [osg-users] How to draw 3D pipe?

2016-11-05 Thread Trajce Nikolov NICK
Hi Daven, can you point me to my code that works :-) I lost track of it :-) Cheers Nick On Sat, Nov 5, 2016 at 8:10 AM, Daven Hem wrote: > Hi, > Trajce Nikolov. > Thank you. Your code works surely. > Would you let me know how can I set 3D pipe's color? > Thank you! > > Cheers, > Dave

Re: [osg-users] How to draw 3D pipe?

2016-11-05 Thread Daven Hem
Hi, Trajce Nikolov Thank you for your reply. We can find your code on this URL: https://groups.google.com/forum/#!topic/osg-users/o8ovoo271lA I changed some colors such as gl_FrontColor in geomSource, but result is odd. The shading effect doesnot work. I attached scene image. Please hint me. Than

Re: [osg-users] How to draw 3D pipe?

2016-11-05 Thread Daven Hem
Hi, Trajce Nikolov Thank you for your reply. We can find your code on this URL: https://groups.google.com/forum/#!topic/osg-users/o8ovoo271lA I changed some colors such as gl_FrontColor in geomSource, but result is odd. The shading effect doesnot work. I attached scene image. Please hint me. Than

Re: [osg-users] How to draw 3D pipe?

2016-11-05 Thread Trajce Nikolov NICK
Hi Daven, you can try gl_FrontColor = vec4(clr,clr,clr,1.0)*vec4(1,0,0,1); It will color it in red. The "shading" is calculated in the color - actually it is not shaded properly, you might want to use some lighting for more proper results. Here is a link for some inspiration: http://www.ozone3d.

Re: [osg-users] How to draw 3D pipe?

2016-11-05 Thread Daven Hem
Hi, Trajce Nikolov Thank you for your kind instruction! I want to learn more from you in future. Bless you and your body. Thanks. Daven Hem -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=69248#69248 __