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

Trajce Nikolov NICK trajce.nikolov.nick at gmail.com
Sat Nov 5 03:08:04 PDT 2016


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 <osgforum at tevs.eu> 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 at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
trajce nikolov nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20161105/9cb68c4e/attachment-0003.htm>


More information about the osg-users mailing list