Hi Lelin,

More recent tutorial to study. (
http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials#YetAnotherSetofBeginnerTutorials
)

Regards.

2009/5/26 Lelin ZHANG <[email protected]>

> Hi, Robert,
>
> Thanks for your reply. I am using the online scene graph tutorial at the
> following link:
>
>
> http://www.openscenegraph.org/projects/osg/attachment/wiki/Support/Tutorials/BasicGeometry/BasicGeometry.cpp
>
> There are codes for adding texture to the pyramid. Even I have commented
> all texture related codes, leaving only simple vertex and color information,
> the colors are not showing up.
>
> By the way, do you know if there is any tutorials that might be much more
> up to date? Thanks very much.
>
> Lelin
>
>
> robertosfield wrote:
> > Hi Lelin,
> >
> > I don't know why your model turns out grey, there is just too small a
> > code fragment to know why.
> >
> > A general note, the uses of vertex indices is now deprecated, and will
> > eventually be dropped, so this tutorual is very out of date.  Could
> > you provide the url of the tutorial so we can look at getting the
> > reference to vertex indices removed to avoid further confusion.
> >
> > Robert.
> >
> > On Tue, May 26, 2009 at 1:34 AM, Lelin ZHANG <> wrote:
> >
> > > Hi,
> > >
> > > I am running the example code for 'basic geometry' of the tutorials. It
> seems that whatever I tried, the colors of the geometry do not show up.
> Everything just turns to be grey. It is frustrating that even I do not make
> any changes of the example codes at all, the colors still do not work. Could
> anyone give me a hint of the problem on this?
> > >
> > > Here are the codes for coloring:
> > >
> > >  osg::Vec4Array* colors = new osg::Vec4Array;
> > >  colors->push_back(osg::Vec4(1.0f, 0.0f, 0.0f, 1.0f) ); //index 0 red
> > >  colors->push_back(osg::Vec4(0.0f, 1.0f, 0.0f, 1.0f) ); //index 1 green
> > >  colors->push_back(osg::Vec4(0.0f, 0.0f, 1.0f, 1.0f) ); //index 2 blue
> > >  colors->push_back(osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f) ); //index 3 white
> > >
> > > osg::TemplateIndexArray
> > >      <unsigned int, osg::Array::UIntArrayType,4,4> *colorIndexArray;
> > >   colorIndexArray =
> > > new osg::TemplateIndexArray<unsigned int,
> osg::Array::UIntArrayType,4,4>;
> > > colorIndexArray->push_back(0);
> > > colorIndexArray->push_back(1);
> > > colorIndexArray->push_back(2);
> > > colorIndexArray->push_back(3);
> > > colorIndexArray->push_back(0);
> > >
> > > pyramidGeometry->setColorArray(colors);
> > > pyramidGeometry->setColorIndices(colorIndexArray);
> > > pyramidGeometry->setColorBinding(osg::Geometry::BIND_PER_VERTEX);
> > > ...
> > >
> > > Thank you!
> > >
> > > Cheers,
> > > Lelin
> > >
> > > ------------------
> > > Read this topic online here:
> > > http://forum.openscenegraph.org/viewtopic.php?p=12933#12933
> > >
> > >
> > >
> > >
> > >
> > > _______________________________________________
> > > osg-users mailing list
> > >
> > >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > >
> > >
> > _______________________________________________
> > osg-users mailing list
> >
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >  ------------------
> > Post generated by Mail2Forum
>
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=12948#12948
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
Ümit Uzun
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to