I'm still seeing the Material colors being used. I can only imaging that you
*don't* get the Material colors because you have somehow turned off lighting. To
make sure lighting is enabled, on your top-level group (or camera), do this:
getOrCreateStateSet()->setMode( GL_LIGHTING,
osg::StateAttribute::ON|osg::StateAttribute::PROTECTED);
I have no idea why you are seeing your TRIANGLE_FANs rendering in the same color
as the QUAD.
-Paul
On 10/11/2011 12:09 PM, Dan West wrote:
Hi Paul,
I changed my camera to a group, but I'm still seeing both geometries as
green. Here's my modified .osg file (i had to remove some of the texture
binding and projection stuff for it to behave like a normal group).
Code:
Group {
UniqueID Camera_0
nodeMask 0xffffffff
cullingActive FALSE
referenceFrame ABSOLUTE
num_children 3
MatrixTransform {
UniqueID MatrixTransform_3
nodeMask 0xffffffff
cullingActive TRUE
referenceFrame RELATIVE
Matrix {
20.46 0 0 0
0 20.48 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 1 1 0 1
diffuseColor 1 1 0 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 1 0 1
}
}
}
}
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 1 0 1 1
diffuseColor 1 0 1 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 0 1
}
}
}
}
MatrixTransform {
nodeMask 0xffffffff
cullingActive TRUE
referenceFrame RELATIVE
Matrix {
1 0 0 0
0 1 0 0
0 0 1 0
30.6717 0.81368 163.731 1
}
num_children 1
Geode {
UniqueID Geode_14
DataVariance DYNAMIC
nodeMask 0xffffffff
cullingActive TRUE
num_drawables 1
Geometry {
UniqueID Geometry_15
DataVariance DYNAMIC
StateSet {
rendering_hint DEFAULT_BIN
renderBinMode INHERIT
Material {
ColorMode OFF
ambientColor 1 0 1 1
diffuseColor 1 0 1 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_16 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_17 Vec3Array 1
{
0 0 1
}
ColorBinding OVERALL
ColorArray UniqueID Vec4Array_18 Vec4Array 1
{
1 0 0 1
}
}
}
}
}
I don't think I'd mentioned it, but this is with OSG 2.8.2, not sure if that
makes a difference.
~ Dan
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=43330#43330
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
--
-Paul Martz Skew Matrix Software
http://www.skew-matrix.com/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org