Hi Robert,

On May 14, 2010, at 2:24 PM, Robert Osfield wrote:

> Hi Ulrich,
> 
> On Fri, May 14, 2010 at 10:30 AM, Ulrich von Zadow
> <u...@archimedes-solutions.de> wrote:
>> shouldn't osgviewer crash as well then? Valgrind reports nothing for 
>> osgviewer with this file.
> 
> It's not crashing by fluke.

No. This is consistent. My program always crashes, osgviewer never crashes.

>> 
>> Loading cube_triangulate.dae from the collada test model database gives this:
>> 
>> CullVisitor::apply(Geode&) detected NaN,
>>    depth=nan, center=(2.26737e+37 -3.28032e+37 -3.28032e+37),
>>    matrix={
>>        nan nan nan nan
>>        nan nan nan nan
>>        nan nan nan nan
>>        nan nan nan nan
>> }
>> 
>> ... repeated lots of times.
> 
> It's a case of "garbage in, garbage out", these errors are just
> symptoms of the original problem with is the broken data.
> 
> You can have to look into what the cause of your corrupted scene graph
> is.  The collada plugin or the original data?

This is one of the official collada test files I'm loading now, so I doubt it's 
the file.

Another data point: osgconv generates a different file than my program. In the 
osgconv version, there are additional VertexIndices and NormalIndices sections. 
Is there any reason that

osgDB::readNodeFile(...)
optimizer.Optimize(...)
osgDB::writeNodeFile(...)

should do something different than what osgconv does?

I'm attaching the file that osgconv produces, with the sections that are 
missing in my version marked with '>>>'.

Cheers,

  Uli

Group {
  name "Collada visual scene group"
  nodeMask 0xffffffff
  cullingActive TRUE
  num_children 3
  MatrixTransform {
    name "Light"
    nodeMask 0xffffffff
    cullingActive TRUE
    description "Light"
    referenceFrame RELATIVE
    Matrix {
      1 0 0 0
      0 1 0 0
      0 0 1 0
      -500 1000 400 1
    }
    num_children 1
    Switch {
      nodeMask 0xffffffff
      cullingActive TRUE
      NewChildDefaultValue 1
      ValueList {
        0
      }
      num_children 1
      LightSource {
        nodeMask 0xffffffff
        cullingActive FALSE
        StateSet {
          UniqueID StateSet_0
          DataVariance STATIC
          rendering_hint DEFAULT_BIN
          renderBinMode INHERIT
          GL_LIGHT0 ON
        }
        referenceFrame RELATIVE
        Light {
          light_num 0
          ambient 0.05 0.05 0.05 1
          diffuse 1 1 1 1
          specular 1 1 1 1
          position 0 0 0 1
          direction 0 0 -1
          constant_attenuation 1
          linear_attenuation 0
          quadratic_attenuation 0
          spot_exponent 0
          spot_cutoff 180
        }
      }
    }
  }
  MatrixTransform {
    name "Box"
    nodeMask 0xffffffff
    cullingActive TRUE
    description "Box"
    referenceFrame RELATIVE
    Matrix {
      1 0 0 0
      0 1 0 0
      0 0 1 0
      0 0 0 1
    }
    num_children 1
    Geode {
      name "box-lib"
      nodeMask 0xffffffff
      cullingActive TRUE
      num_drawables 1
      Geometry {
        DataVariance STATIC
        name "BlueSG"
        StateSet {
          DataVariance STATIC
          rendering_hint DEFAULT_BIN
          renderBinMode INHERIT
          GL_CULL_FACE ON
          Material {
            ColorMode OFF
            ambientColor 0 0 0 1
            diffuseColor 0.137255 0.403922 0.870588 1
            specularColor 0.5 0.5 0.5 1
            emissionColor 0 0 0 1
            shininess 16
          }
        }
        useDisplayList TRUE
        useVertexBufferObjects FALSE
        PrimitiveSets 1
        {
          DrawArrayLengths TRIANGLES 0 1
          {
            36 
          }
        }
        VertexArray Vec3Array 8
        {
          -50 50 50
          50 50 50
          -50 -50 50
          50 -50 50
          -50 50 -50
          50 50 -50
          -50 -50 -50
          50 -50 -50
        }
>>>        VertexIndices IntArray 36
>>>        {
>>>          0 2 3 0 3 1 0 1 5 0
>>>          5 4 6 7 3 6 3 2 0 4
>>>          6 0 6 2 3 7 5 3 5 1
>>>          5 7 6 5 6 4 
>>>        }
        NormalBinding PER_VERTEX
        NormalArray Vec3Array 24
        {
          0 0 1
          0 0 1
          0 0 1
          0 0 1
          0 1 0
          0 1 0
          0 1 0
          0 1 0
          0 -1 0
          0 -1 0
          0 -1 0
          0 -1 0
          -1 0 0
          -1 0 0
          -1 0 0
          -1 0 0
          1 0 0
          1 0 0
          1 0 0
          1 0 0
          0 0 -1
          0 0 -1
          0 0 -1
          0 0 -1
        }
>>>        NormalIndices IntArray 36
>>>        {
>>>          0 1 2 0 2 3 4 5 6 4
>>>          6 7 8 9 10 8 10 11 12 13
>>>          14 12 14 15 16 17 18 16 18 19
>>>          20 21 22 20 22 23 
>>>        }
      }
    }
  }
  MatrixTransform {
    name "pointLight1"
    nodeMask 0xffffffff
    cullingActive TRUE
    description "pointLight1"
    referenceFrame RELATIVE
    Matrix {
      1 0 0 0
      0 1 0 0
      0 0 1 0
      3 4 10 1
    }
    num_children 1
    Switch {
      nodeMask 0xffffffff
      cullingActive TRUE
      NewChildDefaultValue 1
      ValueList {
        0
      }
      num_children 1
      LightSource {
        nodeMask 0xffffffff
        cullingActive FALSE
        Use StateSet_0
        referenceFrame RELATIVE
        Light {
          light_num 1
          ambient 0.05 0.05 0.05 1
          diffuse 1 1 1 1
          specular 1 1 1 1
          position 0 0 0 1
          direction 0 0 -1
          constant_attenuation 1
          linear_attenuation 0
          quadratic_attenuation 0
          spot_exponent 0
          spot_cutoff 180
        }
      }
    }
  }
}


--
Ulrich von Zadow
Software Engineer (Dipl. Inf.)
Exhibit Development

Tel +49 (0)30 / 2000 577 12
Fax +49 (0)30 / 2000 577 20
Skype: uzadow

Archimedes Solutions GmbH
Saarbrücker Str. 24 10405 Berlin

www.archimedes-solutions.com

Geschäftsführung:
W. Rien | J. Schmidtsiefen | S. Spenling

Amtsgericht: Berlin Charlottenburg
HR Nr.: 107563 B
UST-ID Nr.: DE-253.771.793








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

Reply via email to