On 10/10/2011 4:55 PM, Dan West wrote:
I've exported my subgraph to the .osg format, but it wouldn't load in osgviewer 
(possibly since it's a camera?).

I've looked at the exported file in a text editor, but it looks to me like 
everything has vertices, colors, and normals as they should. Could someone with 
more experience take a look? Am I missing anything here or have I set something 
up wrong?

In your original post, you said you weren't using Material colors. But in the .osg file below, you *are* using Material colors, and they're set the same for both objects. Lighting is on by default in OSG, so that's why your objects are rendered in the same color.
   -Paul



Code:

Camera {
   UniqueID Camera_0
   nodeMask 0xffffffff
   cullingActive FALSE
   StateSet {
     rendering_hint DEFAULT_BIN
     renderBinMode INHERIT
     Viewport {
       UniqueID Viewport_1
       x 0
       y 0
       width 2046
       height 2048
     }
     textureUnit 0 {
     }
     textureUnit 1 {
     }
     textureUnit 2 {
     }
     textureUnit 3 {
       GL_TEXTURE_GEN_S OVERRIDE|OFF
       GL_TEXTURE_GEN_T OVERRIDE|OFF
       GL_TEXTURE_GEN_R OVERRIDE|OFF
       GL_TEXTURE_GEN_Q OVERRIDE|OFF
       TexGen {
         mode OBJECT_LINEAR
         plane_s 1 0 0 0
         plane_t 0 1 0 0
         plane_r 0 0 1 0
         plane_q 0 0 0 1
       }
     }
   }
   referenceFrame ABSOLUTE
   clearColor 0 0.4 0 1
   clearMask 0x100
   Use Viewport_1
   transformOrder PRE_MULTIPLY
   ProjectionMatrix {
     0.000977517 0 0 0
     0 0.000976563 0 0
     0 0 -0.002002 0
     -0 -0 -1.002 1
   }
   ViewMatrix {
     1 0 -0 0
     -0 1 -0 0
     0 0 1 0
     0 0 -500 1
   }
   renderOrder PRE_RENDER
   renderTargetImplementation FRAME_BUFFER_OBJECT
   renderTargetFallback PIXEL_BUFFER_RTT
   drawBuffer 0
   readBuffer 0
   bufferComponent COLOR_BUFFER {
     internalFormat 0
     Texture2D {
       UniqueID Texture2D_2
       DataVariance DYNAMIC
       wrap_s CLAMP
       wrap_t CLAMP
       wrap_r CLAMP
       min_filter LINEAR
       mag_filter LINEAR
       maxAnisotropy 1
       borderColor 0 0 0 0
       borderWidth 0
       useHardwareMipMapGeneration TRUE
       unRefImageDataAfterApply FALSE
       internalFormatMode USE_USER_DEFINED_FORMAT
       internalFormat GL_RGBA
       resizeNonPowerOfTwo TRUE
     }
     level 0
     face 0
     mipMapGeneration FALSE
   }
   num_children 2
   MatrixTransform {
     UniqueID MatrixTransform_3
     nodeMask 0xffffffff
     cullingActive TRUE
     referenceFrame RELATIVE
     Matrix {
       2046 0 0 0
       0 2048 0 0
       0 0 1 0
       0 0 0 1
     }
     num_children 1
     Geode {
       UniqueID Geode_4
       DataVariance DYNAMIC
       nodeMask 0xffffffff
       cullingActive TRUE
       num_drawables 1
       Geometry {
         UniqueID Geometry_5
         DataVariance DYNAMIC
         StateSet {
           rendering_hint DEFAULT_BIN
           renderBinMode INHERIT
           Material {
             ColorMode OFF
             ambientColor 0.2 0.2 0.2 1
             diffuseColor 0.8 0.8 0.8 1
             specularColor 0 0 0 1
             emissionColor 0 0 0 1
             shininess 0
           }
         }
         useDisplayList TRUE
         useVertexBufferObjects FALSE
         PrimitiveSets 1
         {
           DrawArrays QUADS 0 4
         }
         VertexArray UniqueID Vec3Array_6 Vec3Array 4
         {
           0.5 0.5 0
           -0.5 0.5 0
           -0.5 -0.5 0
           0.5 -0.5 0
         }
         NormalBinding OVERALL
         NormalArray UniqueID Vec3Array_7 Vec3Array 1
         {
           0 0 1
         }
         ColorBinding OVERALL
         ColorArray UniqueID Vec4Array_8 Vec4Array 1
         {
           0.8 0.8 0.8 0.8
         }
       }
     }
   }
   MatrixTransform {
     nodeMask 0xffffffff
     cullingActive TRUE
     referenceFrame RELATIVE
     Matrix {
       1 0 0 0
       0 1 0 0
       0 0 1 0
       0 0 0 1
     }
     num_children 1
     Geode {
       UniqueID Geode_9
       DataVariance DYNAMIC
       nodeMask 0xffffffff
       cullingActive TRUE
       num_drawables 1
       Geometry {
         UniqueID Geometry_10
         DataVariance DYNAMIC
         StateSet {
           rendering_hint DEFAULT_BIN
           renderBinMode INHERIT
           Material {
             ColorMode OFF
             ambientColor 0.2 0.2 0.2 1
             diffuseColor 0.8 0.8 0.8 1
             specularColor 0 0 0 1
             emissionColor 0 0 0 1
             shininess 0
           }
         }
         useDisplayList TRUE
         useVertexBufferObjects FALSE
         PrimitiveSets 1
         {
           DrawArrays TRIANGLE_FAN 0 18
         }
         VertexArray UniqueID Vec3Array_11 Vec3Array 18
         {
           0 0 0
           1 0 0
           0.92388 0.382683 0
           0.707107 0.707107 0
           0.382683 0.92388 0
           6.12323e-017 1 0
           -0.382683 0.92388 0
           -0.707107 0.707107 0
           -0.92388 0.382683 0
           -1 1.22465e-016 0
           -0.92388 -0.382683 0
           -0.707107 -0.707107 0
           -0.382683 -0.92388 0
           -1.83697e-016 -1 0
           0.382683 -0.92388 0
           0.707107 -0.707107 0
           0.92388 -0.382683 0
           1 0 0
         }
         NormalBinding OVERALL
         NormalArray UniqueID Vec3Array_12 Vec3Array 1
         {
           0 0 1
         }
         ColorBinding OVERALL
         ColorArray UniqueID Vec4Array_13 Vec4Array 1
         {
           1 0 1 1
         }
       }
     }
   }
}




Thanks for the help,
~ Dan

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=43308#43308





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




--
  -Paul Martz      Skew Matrix Software
                   http://www.skew-matrix.com/

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

Reply via email to