[osg-users] quads deprecated, resulting in triangles in wireframe mode

2010-02-01 Thread René Molenaar
Hello osg-users,

I noticed that the latest developers release (2.9.6) translates quads to
triangles.
Very large models need to be chopped into smaller pieces for this
translation to work,
but in most cases it goes unnoticed.. until, you switch to wireframe.
Now we see the triangles. For example:

boxGeode->addDrawable(new osg::ShapeDrawable(new osg::Box(center, lx, ly,
lz)));

now renders triangles instead of quads ..

Is there an easy way to render the wireframe mode 'as-if' quads are used?

cheers,

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


Re: [osg-users] quads deprecated, resulting in triangles in wireframe mode

2010-02-01 Thread Paul Martz

René Molenaar wrote:
I noticed that the latest developers release (2.9.6) translates quads to 
triangles.
Very large models need to be chopped into smaller pieces for this 
translation to work,

but in most cases it goes unnoticed.. until, you switch to wireframe.
Now we see the triangles. For example:

boxGeode->addDrawable(new osg::ShapeDrawable(new osg::Box(center, lx, 
ly, lz)));


now renders triangles instead of quads ..

Is there an easy way to render the wireframe mode 'as-if' quads are used?


You could make a wireframe box using GL_LINE_LOOP and GL_LINE_STRIP 
primitives. osgWorks (osgworks.googlecode.com) has a convenience routine 
for this; see osgwTools/Shapes.cpp/.h.

   -Paul



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


Re: [osg-users] quads deprecated, resulting in triangles in wireframe mode

2010-02-01 Thread René Molenaar
Thanks Paul,

It seems to me that I would need a similar convenience routine that creates
GL_LINE_... primitives for arbitrary geometry.
The thing is a lot of fe-models still use quads, end-users expect to see
quads for their fe-models.

René


2010/2/1 Paul Martz 

> René Molenaar wrote:
>
>> I noticed that the latest developers release (2.9.6) translates quads to
>> triangles.
>> Very large models need to be chopped into smaller pieces for this
>> translation to work,
>> but in most cases it goes unnoticed.. until, you switch to wireframe.
>> Now we see the triangles. For example:
>>
>> boxGeode->addDrawable(new osg::ShapeDrawable(new osg::Box(center, lx, ly,
>> lz)));
>>
>> now renders triangles instead of quads ..
>>
>> Is there an easy way to render the wireframe mode 'as-if' quads are used?
>>
>
> You could make a wireframe box using GL_LINE_LOOP and GL_LINE_STRIP
> primitives. osgWorks (osgworks.googlecode.com) has a convenience routine
> for this; see osgwTools/Shapes.cpp/.h.
>   -Paul
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] quads deprecated, resulting in triangles in wireframe mode

2010-02-01 Thread Paul Martz

René Molenaar wrote:

Thanks Paul,

It seems to me that I would need a similar convenience routine that 
creates GL_LINE_... primitives for arbitrary geometry.
The thing is a lot of fe-models still use quads, end-users expect to see 
quads for their fe-models.


In general, then, I'd advise you to stick to GL1/2 and use GL_QUADS 
PrimitiveSets in Geometry-type Drawables, and GL_LINE polygon mode.


Or, knowing that all modern graphics hardware draws a quad as two 
triangles, the other way to handle this would be to keep two 
representations of your model, one for fill, and one for line. They 
could easily share the same vertex data, so this should not consume a 
substantial amount of resources.


So you have many options available to you.
   -Paul

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


Re: [osg-users] quads deprecated, resulting in triangles in wireframe mode

2010-02-01 Thread René Molenaar
Thank you,

I will experiment with the latter option (as the first one is currently
already working with osg 2.8.2).

I bet this question will be repeated in the future.. ;-)

cheers,

René

2010/2/1 Paul Martz 

> René Molenaar wrote:
>
>> Thanks Paul,
>>
>> It seems to me that I would need a similar convenience routine that
>> creates GL_LINE_... primitives for arbitrary geometry.
>> The thing is a lot of fe-models still use quads, end-users expect to see
>> quads for their fe-models.
>>
>
> In general, then, I'd advise you to stick to GL1/2 and use GL_QUADS
> PrimitiveSets in Geometry-type Drawables, and GL_LINE polygon mode.
>
> Or, knowing that all modern graphics hardware draws a quad as two
> triangles, the other way to handle this would be to keep two representations
> of your model, one for fill, and one for line. They could easily share the
> same vertex data, so this should not consume a substantial amount of
> resources.
>
> So you have many options available to you.
>
>   -Paul
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] quads deprecated, resulting in triangles in wireframe mode

2010-02-01 Thread Paul Martz

René Molenaar wrote:

I bet this question will be repeated in the future.. ;-)


Probably. The issue you encountered is why I wrote the makeWireBox() 
function in osgWorks. :-)

   -Paul

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