[osg-users] Rendering double triangles as one quad
OpenSceneGraph Users
osg-users at lists.openscenegraph.org
Tue Jun 2 00:09:09 PDT 2020
Hi, sorry i accidentally removed my original post when trying to answer...
GL_QUADS is not an option, pretty sure its also deprecated. The idea is to
render a triangle mesh without the redundant diagonal between two triangles.
"Hello osg forum!
My current way of rendering mesh is through GL_TRIANGLES,
indices = static_cast<osg::DrawElements*>(new osg::DrawElementsUShort(GL_TRIANGLES));
here is an example of a cube face mesh
https://imgur.com/a/AajeO4b
, where i push in the indices as 0,1,2,2,3,0.
What i would like to accomplish is creating a facet of vertex 0,1,2,3 by
drawing triangles but without visualizing the diagonal line, so that it
looks like one single quad. if i draw my elements using GL_LINE_LOOP i
accomplish this but that creates complications as the osg intersector does
not work since no facets are being created.
How would you go about solving this issue? Naturally, im flexible in how i
generate my mesh, im writing the fragment/vertex shaders myself as well so
if there is a way of hiding the line there its an option.
Thanks in advance, i'll add more information if needed
//Best regards Dan"
Den måndag 1 juni 2020 kl. 17:40:32 UTC+2 skrev OpenSceneGraph Users:
>
> Hi,
>
> you can try GL_QUADS
>
> On Mon, Jun 1, 2020 at 3:51 PM OpenSceneGraph Users <
> osg-... at lists.openscenegraph.org <javascript:>> wrote:
>
>> Hello osg forum!
>>
>> My current way of rendering mesh is through GL_TRIANGLES,
>>
>> indices = static_cast<osg::DrawElements*>(new osg::DrawElementsUShort(GL_TRIANGLES));
>>
>>
>> here is an example of a cube face mesh
>>
>> https://imgur.com/a/AajeO4b
>>
>> , where i push in the indices as 0,1,2,2,3,0.
>>
>> What i would like to accomplish is creating a facet of vertex 0,1,2,3 by
>> drawing triangles but without visualizing the diagonal line, so that it
>> looks like one single quad. if i draw my elements using GL_LINE_LOOP i
>> accomplish this but that creates complications as the osg intersector does
>> not work since no facets are being created.
>>
>> How would you go about solving this issue? Naturally, im flexible in how
>> i generate my mesh, im writing the fragment/vertex shaders myself as well
>> so if there is a way of hiding the line there its an option.
>>
>> Thanks in advance, i'll add more information if needed
>>
>> //Best regards Dan
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "OpenSceneGraph Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to osg-... at googlegroups.com <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/osg-users/f2317fb0-5ca6-4ff8-83d1-174d713d26ef%40googlegroups.com
>> <https://groups.google.com/d/msgid/osg-users/f2317fb0-5ca6-4ff8-83d1-174d713d26ef%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> _______________________________________________
>> osg-users mailing list
>> osg-... at lists.openscenegraph.org <javascript:>
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
> --
> trajce nikolov nick
>
--
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+unsubscribe at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/5dddabd9-da1e-44f0-86f1-1dfdba12fbed%40googlegroups.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20200602/f0469fbb/attachment.html>
More information about the osg-users
mailing list