Hi Marcus, For examples of how to set the colour have a look at the osggeometry example.
On 6/7/07, Marcus Fritzen <[EMAIL PROTECTED]> wrote:
So I have taken a look at the osg file I get for my Scene. There is no part for an ColorArray oder something like this. Everything is "fine" until I add a stateset to a child. Attached is the important part of the osg file before and after setting the stateset. Perhaps someone cann help me because I can't get any further. I also tried to set a ColorArray, but I don't know how. All I have are two nodes with the read object files and I can't just do node->setColorArray... Greets, Marcus Robert Osfield schrieb: > On 6/6/07, Marcus Fritzen <[EMAIL PROTECTED]> wrote: >> So, now for me it is the case that I just load the geometry from a file. >> From this file I also get the information of the color so that I don't >> have any color array or something like this at all. Does this means that >> the my base quad inherts the stateset from my avatar node and that I >> just have to create an own stateset for the base quad to avoid this? > > If the source data doesn't have a colour array entry then you'll need > to add one, this is a colour arrays issue rather than a StateSet > issue. Converting to .osg will enable you to go in add an back in the > colour array which is supposed to be there. See the > OpenSceneGraph-Data for examples osg colour arrays in action. > _______________________________________________ > osg-users mailing list > osg-users@openscenegraph.net > http://openscenegraph.net/mailman/listinfo/osg-users > http://www.openscenegraph.org/ > -- ---------------------------------------------------------------- Marcus Fritzen E-mail: [EMAIL PROTECTED] University Koblenz Mobil: +491786867360 Triererstr. 105, 56072 Koblenz, HIWI FB4 Herr Jackel ---------------------------------------------------------------- Group { DataVariance UNSPECIFIED nodeMask 0xffffffff cullingActive TRUE num_children 2 osgShadow::ShadowedScene { UniqueID ShadowedScene_0 DataVariance UNSPECIFIED osgShadow::ShadowMap { UniqueID ShadowMap_1 DataVariance UNSPECIFIED } num_children 2 Group { UniqueID Group_2 DataVariance UNSPECIFIED nodeMask 0x3 cullingActive TRUE num_children 2 PositionAttitudeTransform { UniqueID PositionAttitudeTransform_3 DataVariance UNSPECIFIED nodeMask 0xffffffff cullingActive TRUE referenceFrame RELATIVE position 0 0 31 attitude 0 0 0 1 scale 1 1 1 pivotPoint 0 0 0 num_children 1 Group { UniqueID Group_4 DataVariance UNSPECIFIED name "AvatarNode" nodeMask 0xffffffff cullingActive TRUE num_children 1 Geode { DataVariance UNSPECIFIED name "Figure 1" nodeMask 0xffffffff cullingActive TRUE num_drawables 1 Geometry { DataVariance UNSPECIFIED useDisplayList TRUE useVertexBufferObjects FALSE PrimitiveSets 3287 { DrawElementsUShort TRIANGLE_STRIP 6 { 185 176 184 179 355 354 . . . } } VertexArray Vec3Array 12484 { -0.001476 -0.908869 -0.632113 -0.001476 -0.917936 -0.630771 . . . } TexCoordArray 0 Vec2Array 12484 { 0 1 0 1 . . . } } } } } Group { UniqueID Group_5 DataVariance UNSPECIFIED name "PlaneNode" nodeMask 0xffffffff cullingActive TRUE num_children 1 Geode { DataVariance UNSPECIFIED name "pPlane1" nodeMask 0xffffffff cullingActive TRUE num_drawables 1 Geometry { DataVariance UNSPECIFIED StateSet { DataVariance UNSPECIFIED rendering_hint DEFAULT_BIN renderBinMode INHERIT Material { DataVariance UNSPECIFIED ColorMode OFF ambientColor 0 0 0 1 diffuseColor 1 0 0 1 specularColor 0 0 0 1 emissionColor 0 0 0 1 shininess 0 } } useDisplayList TRUE useVertexBufferObjects FALSE PrimitiveSets 18 { DrawElementsUShort TRIANGLE_STRIP 16 { 20 21 18 19 16 17 14 15 12 13 10 11 8 9 6 7 } DrawElementsUShort TRIANGLE_STRIP 16 { 21 32 19 31 17 30 15 29 13 28 11 27 9 26 7 25 } . . . DrawElementsUShort TRIANGLES 6 { 4 6 7 100 110 111 } } VertexArray Vec3Array 121 { -50 -50 -0 -40 -50 -0 -40 -40 -0 -50 -40 -0 . . . } NormalBinding PER_VERTEX NormalArray Vec3Array 121 { 0 -0 1 0 -0 1 0 -0 1 0 -0 1 . . . } TexCoordArray 0 Vec2Array 121 { 0 0 0.1 0 0.1 0.1 0 0.1 0.2 0 . . . } } } } } . . . Group { DataVariance UNSPECIFIED nodeMask 0xffffffff cullingActive TRUE num_children 2 osgShadow::ShadowedScene { UniqueID ShadowedScene_0 DataVariance UNSPECIFIED osgShadow::ShadowMap { UniqueID ShadowMap_1 DataVariance UNSPECIFIED } num_children 2 Group { UniqueID Group_2 DataVariance UNSPECIFIED nodeMask 0x3 cullingActive TRUE num_children 2 PositionAttitudeTransform { UniqueID PositionAttitudeTransform_3 DataVariance UNSPECIFIED nodeMask 0xffffffff cullingActive TRUE referenceFrame RELATIVE position 0 0 31 attitude 0 0 0 1 scale 1 1 1 pivotPoint 0 0 0 num_children 1 Group { UniqueID Group_4 DataVariance UNSPECIFIED name "AvatarNode" nodeMask 0xffffffff cullingActive TRUE StateSet { DataVariance UNSPECIFIED rendering_hint DEFAULT_BIN renderBinMode INHERIT textureUnit 0 { GL_TEXTURE_2D ON Texture2D { DataVariance UNSPECIFIED file "wholeAvatar.jpg" wrap_s CLAMP wrap_t CLAMP wrap_r CLAMP min_filter LINEAR_MIPMAP_LINEAR mag_filter LINEAR maxAnisotropy 1 borderColor 0 0 0 0 borderWidth 0 useHardwareMipMapGeneration TRUE unRefImageDataAfterApply FALSE internalFormatMode USE_IMAGE_DATA_FORMAT resizeNonPowerOfTwo TRUE } } } num_children 1 Geode { DataVariance UNSPECIFIED name "Figure 1" nodeMask 0xffffffff cullingActive TRUE num_drawables 1 Geometry { DataVariance UNSPECIFIED useDisplayList TRUE useVertexBufferObjects FALSE PrimitiveSets 3287 { DrawElementsUShort TRIANGLE_STRIP 6 { 185 176 184 179 355 354 } DrawElementsUShort TRIANGLE_STRIP 5 { 354 179 178 176 177 } . . . the rest is the same as in before.osg _______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/