[osg-users] Draw a triangle with front and back faces

Ruqin Zhang ruzhang at gmail.com
Wed Mar 18 08:43:32 PDT 2009


Thanks Robert. Alright, here is the deal. I'm trying to draw a 3D triangular
mesh with osg. For some mesh, the calculated normal points
to the inside. So, I want to draw both the front and back faces, which have
opposite normals. Then you can render the mesh visible.
Is there an example of this? Thanks!

Ruqin

2009/3/18 Robert Osfield <robert.osfield at gmail.com>

> Hi Ruqin,
>
> The OSG uses exactly the same name conventions and state granularity as
> OpenGL, typically you just need to change glName to osg::Name to find the
> right class to work with.
>
> In your case are you simply looking for two sided lighting?
>
> Robert.
>
> 2009/3/18 Ruqin Zhang <ruzhang at gmail.com>
>
>> Hi,
>>
>> I am trying to draw a triangle with filled front and back faces. In this
>> way,
>> even the normal of it has a wrong direction, I can still have it rendered
>> correctly.
>> I know how to do this in OpenGL, while didn't figure it out in OSG. Has
>> anyone
>> done this before? Please help me out with some sample code. Thanks a lot!
>>
>> Ruqin
>>
>> _______________________________________________
>> osg-users mailing list
>> osg-users at lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20090318/c08256af/attachment-0003.htm>


More information about the osg-users mailing list