Hi Simon,
I've merged your changes and checked them in. I don't have any ply
files so have taken it on trust that the changes are safe. I noted on
merging that the indenting you've used in not consistent with the rest
of the OSG, which make it jarring and more difficult to follow when
moving from other OSG codes and these, so could you try to follow the
standard indentation style. The key is 4 spaces for indentation, and
{ } on a newline and at the same indentation level as the
for/if/while/switch statement.
Thanks,
Robert.
On Thu, Jan 20, 2011 at 5:53 AM, Simon Julier <[email protected]> wrote:
> Dear Robert,
>
> I have been using the ply plugin to read files created by bundler and pmvs2
> (http://grail.cs.washington.edu/software/pmvs/). This program generates
> models in the form of vertices only. However, the existing ply reader
> implementation was not able to handle the models generated in a satisfactory
> manner for two reasons:
>
> 1. It did not support normals applied to individual vertices.
> 2. It would only support red / green / blue colour triples, but the pmvs
> models are generated with diffuse colours. (The PLY format,
> http://local.wasp.uwa.edu.au/~pbourke/dataformats/ply/, lists specular and
> ambient colour forms as well.)
>
> To partially overcome these limitations, please find attached modified
> versions of
>
> src/osgPlugins/ply/vertexData.cpp
> src/osgPlugins/ply/vertexData.h
>
> The changes I've made are:
>
> 1. I have changed the boolean hasColor flag to a vertexField (which is a
> boolean operation on an enum) to indicate what fields are present in the ply
> file. (This is required because Turk's ply reader spits out warnings for
> every line where you try to read fields which do not exist.)
> 2. I have modified the code to apply valid normals to either triangles or
> vertices.
> 3. I have kludged in "support" for the various colour variants.
> Specifically, all the colour specified can be read from the file. However,
> they are all applied in the same way (namely as a colour array, bound to
> each vertex).
>
> I've tested the code under Linux using a few data sets from the Stanford PLY
> repository and some pmvs2-generated data.
>
> Cheers,
>
> Simon
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org