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




___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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.net/tutorials/glsl_lighting_phong.php

Hope this helps

Cheers!
Nick

On Sat, Nov 5, 2016 at 8:54 AM, Daven Hem  wrote:

> 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.
> Thank you!
>
> Cheers,
> Daven
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=69245#69245
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
trajce nikolov nick
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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.
Thank you!

Cheers,
Daven :D

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=69246#69246




___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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.
Thank you!

Cheers,
Daven

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=69245#69245




___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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,
> Daven
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=69243#69243
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
trajce nikolov nick
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

On Wed, Jul 13, 2016 at 7:26 PM, Chris Hanson  wrote:

> 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,
>> compressed air, water, phone …
>> I am rendering 3D pipe in our 3d viewer.
>>
>
>
>> My problem is as following:
>> There are some points which define shape of pipe.
>> a)  Draw line which pass through their points.
>> b)  Draw curve which smooth the line, with line interpolation
>> segments.
>> It may be smooth line or spline or bezier.
>> c)  Draw 3D pipe from this curve with parameters such as radius,
>> section interpolation segments.
>> Please review my attached image file.
>>
>
>   I didn't see the attached file. I did some work like this previously for
> a petro-geophysical subsurface viewer depicting wells and such. We used all
> FFP because it needed to run onder Windows' Terminal Server environment
> where there was no OpenGL 2.x/shaders available. But As Nick says, today it
> would be best to use shaders to construct the polygons on the fly from the
> pipe centerlines.
>
> d)  Finally, simulate real-time animation of 3D pipe follows excavator.
>>
>
>   So, you want to make a progressive animation of the excavator laying the
> pipe into the ground? With pipe deformation and stuff as it unrolls from a
> spool or something? It could be done, probably with only basic physics and
> not a full physics engine. how critical is this, because it's as much work
> as the rest of it put together, probably, and it sounds like it's just for
> show, not for a super necessary requirement.
>
> Please let me know the easy and fast solution! I hope your detailed advice.
>>
>
>   There may not be an easy and fast solution that someone can just tell
> you by email.
>
>
>> Thanks again.
>> Kind reply.
>>
>
> --
> Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
> http://www.alphapixel.com/
> Training • Consulting • Contracting
> 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4
> • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
> Legal/IP • Code Forensics • Digital Imaging • GIS • GPS •
> osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile •
> iPhone/iPad/iOS • Android
> @alphapixel  facebook.com/alphapixel (775)
> 623-PIXL [7495]
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>


-- 
trajce nikolov nick
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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,
> compressed air, water, phone …
> I am rendering 3D pipe in our 3d viewer.
>


> My problem is as following:
> There are some points which define shape of pipe.
> a)  Draw line which pass through their points.
> b)  Draw curve which smooth the line, with line interpolation segments.
> It may be smooth line or spline or bezier.
> c)  Draw 3D pipe from this curve with parameters such as radius,
> section interpolation segments.
> Please review my attached image file.
>

  I didn't see the attached file. I did some work like this previously for
a petro-geophysical subsurface viewer depicting wells and such. We used all
FFP because it needed to run onder Windows' Terminal Server environment
where there was no OpenGL 2.x/shaders available. But As Nick says, today it
would be best to use shaders to construct the polygons on the fly from the
pipe centerlines.

d)  Finally, simulate real-time animation of 3D pipe follows excavator.
>

  So, you want to make a progressive animation of the excavator laying the
pipe into the ground? With pipe deformation and stuff as it unrolls from a
spool or something? It could be done, probably with only basic physics and
not a full physics engine. how critical is this, because it's as much work
as the rest of it put together, probably, and it sounds like it's just for
show, not for a super necessary requirement.

Please let me know the easy and fast solution! I hope your detailed advice.
>

  There may not be an easy and fast solution that someone can just tell you
by email.


> Thanks again.
> Kind reply.
>

-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 •
GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Legal/IP • Code Forensics • Digital Imaging • GIS • GPS •
osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile •
iPhone/iPad/iOS • Android
@alphapixel  facebook.com/alphapixel (775)
623-PIXL [7495]
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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 making money on technology like this. So might be an advanced

There are contractors here on this list that might help you if you can
out-source work too :-) .. (time for commercials :-)

On Wed, Jul 13, 2016 at 6:57 PM, Daven Hem  wrote:

> 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, power,
> compressed air, water, phone …
> I am rendering 3D pipe in our 3d viewer.
> I’ve already read many topics, including “osgModeling” by Wang Rui
> But I didn’t see sample codes, detailed replies and I don’t decide the
> solution now.
> I may use osgModeling library.
> I want to hear the best advice from awesome Open Scene Graph.
> My problem is as following:
>
> There are some points which define shape of pipe.
> a)  Draw line which pass through their points.
> b)  Draw curve which smooth the line, with line interpolation segments.
> It may be smooth line or spline or bezier.
> c)  Draw 3D pipe from this curve with parameters such as radius,
> section interpolation segments.
> Please review my attached image file.
> d)  Finally, simulate real-time animation of 3D pipe follows excavator.
>
> Please let me know the easy and fast solution! I hope your detailed advice.
> Thanks again.
> Kind reply.
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=68122#68122
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
trajce nikolov nick
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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 from the 
tangent. Then you can rotate that point about the tangent axis in order to 
get the rest of the points of the ring. You can repeat this procedure as many 
times as rings you want.

But now that I realize, maybe that feature is already implemented in 
osgModeling by Wang Rui (http://code.google.com/p/osgmodeling/)

Regards,

Alberto

El Viernes 26 Junio 2009ES 08:05:52 forest escribió:
> 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.
>best regards
>  forest


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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 in advance.
  best regards
forest


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
  
If you have a pipe with straight sections and bends, it's easy to create 
cylinders for each straight segment and spheres at the joint points (bends).
If the curve is really a curve, you'll have to do something more complex 
depending on your curve equation.


Laurent.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org