after created a billboard as in the example at at (also see code.txt).
http://www.cs.clemson.edu/~malloy/courses/3dgames-2007/tutor/web/billboards/billboards/scene.cpp
( i used this since createTextureQuad did not link)
primitiveset was an error pointer so when DrawArrays->getMode causes an error,
but as you can see in the code i have created the primitiveset
Erlend
using osg 2.3.7 vista
_createSquare(const osg::Vec3& corner,const osg::Vec3& width,const osg::Vec3&
height, osg::Image* image)
{
// set up the Geometry.
osg::Geometry* geom = new osg::Geometry;
osg::Vec3Array* coords = new osg::Vec3Array(4);
(*coords)[0] = corner;
(*coords)[1] = corner+width;
(*coords)[2] = corner+width+height;
(*coords)[3] = corner+height;
geom->setVertexArray(coords);
osg::Vec3Array* norms = new osg::Vec3Array(1);
(*norms)[0] = width^height;
(*norms)[0].normalize();
geom->setNormalArray(norms);
geom->setNormalBinding(osg::Geometry::BIND_OVERALL);
osg::Vec2Array* tcoords = new osg::Vec2Array(4);
(*tcoords)[0].set(0.0f,0.0f);
(*tcoords)[1].set(1.0f,0.0f);
(*tcoords)[2].set(1.0f,1.0f);
(*tcoords)[3].set(0.0f,1.0f);
geom->setTexCoordArray(0,tcoords);
geom->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::QUADS,0,4));
if (image)
{
osg::StateSet* stateset = new osg::StateSet;
osg::Texture2D* texture = new osg::Texture2D;
texture->setImage(image);
stateset->setTextureAttributeAndModes(0,texture,osg::StateAttribute::ON);
geom->setStateSet(stateset);
}
return geom;> osg33-osgd.dll!osg::PrimitiveSet::getMode() Line 252 + 0x11 bytes
> C++
osg33-osgd.dll!osg::Geometry::accept(osg::PrimitiveFunctor &
functor={...}) Line 2277 + 0x8 bytes C++
osg33-osgd.dll!osg::Drawable::computeBound() Line 764 + 0x13 bytes
C++
osg33-osgd.dll!osg::Drawable::getBound() Line 200 + 0x13 bytes C++
osg33-osgd.dll!osg::Billboard::computeBound() Line 317 + 0x8 bytes
C++
osg33-osgd.dll!osg::Node::getBound() Line 268 + 0x13 bytes C++
osg33-osgd.dll!osg::Group::computeBound() Line 357 + 0x16 bytes
C++
osg33-osgd.dll!osg::Node::getBound() Line 268 + 0x13 bytes C++
osg33-osgd.dll!osg::Node::isCullingActive() Line 191 + 0x39 bytes
C++
osg33-osgd.dll!osg::CullStack::isCulled(const osg::Node & node={...})
Line 109 + 0x8 bytes C++
osg33-osgUtild.dll!osgUtil::CullVisitor::apply(osg::Group & node={...})
Line 969 + 0x12 bytes C++
osg33-osgd.dll!osg::Group::accept(osg::NodeVisitor & nv={...}) Line 38
+ 0x41 bytes C++
osg33-osgUtild.dll!osgUtil::SceneView::cullStage(const osg::Matrixd &
projection={...}, const osg::Matrixd & modelview={...}, osgUtil::CullVisitor *
cullVisitor=0x1a202618, osgUtil::StateGraph * rendergraph=0x1a2b5690,
osgUtil::RenderStage * renderStage=0x1a2b5780) Line 821 + 0x42 bytes C++
osg33-osgUtild.dll!osgUtil::SceneView::cull() Line 687 + 0x4e bytes
C++
when not stepping i get this callstack:
ntdll.dll!777e0004()
[Frames below may be incorrect and/or missing, no symbols loaded for
ntdll.dll]
> msvcr80d.dll!_CrtDbgBreak() Line 89 C
msvcr80d.dll!_VCrtDbgReportW(int nRptType=2, const wchar_t *
szFile=0x1039c478, int nLine=71, const wchar_t * szModule=0x00000000, const
wchar_t * szFormat=0x103a1788, char * arglist=0x0016fd0c) Line 505 C
msvcr80d.dll!_CrtDbgReportWV(int nRptType=2, const wchar_t *
szFile=0x1039c478, int nLine=71, const wchar_t * szModule=0x00000000, const
wchar_t * szFormat=0x103a1788, char * arglist=0x0016fd0c) Line 300 + 0x1d
bytes C++
msvcr80d.dll!_CrtDbgReportW(int nRptType=2, const wchar_t *
szFile=0x1039c478, int nLine=71, const wchar_t * szModule=0x00000000, const
wchar_t * szFormat=0x103a1788, ...) Line 317 + 0x1d bytes C++
osg33-osgd.dll!std::_Vector_const_iterator<osg::ref_ptr<osg::PrimitiveSet>,std::allocator<osg::ref_ptr<osg::PrimitiveSet>
>
>::_Vector_const_iterator<osg::ref_ptr<osg::PrimitiveSet>,std::allocator<osg::ref_ptr<osg::PrimitiveSet>
> >(osg::ref_ptr<osg::PrimitiveSet> * _Ptr=0x1ab1aef8, const
std::_Container_base * _Pvector=0x1ab19af4) Line 71 + 0x38 bytes C++
osg33-osgd.dll!std::vector<osg::ref_ptr<osg::PrimitiveSet>,std::allocator<osg::ref_ptr<osg::PrimitiveSet>
> >::begin() Line 633 + 0x13 bytes C++
osg33-osgd.dll!osg::Geometry::accept(osg::PrimitiveFunctor &
functor={...}) Line 2272 + 0x12 bytes C++
osg33-osgd.dll!osg::Drawable::computeBound() Line 764 + 0x13 bytes
C++
osg33-osgd.dll!osg::Drawable::getBound() Line 200 + 0x13 bytes C++
osg33-osgd.dll!osg::Billboard::computeBound() Line 317 + 0x8 bytes
C++
osg33-osgd.dll!osg::Node::getBound() Line 268 + 0x13 bytes C++
osg33-osgd.dll!osg::Group::computeBound() Line 357 + 0x16 bytes
C++
osg33-osgd.dll!osg::Node::getBound() Line 268 + 0x13 bytes C++
osg33-osgd.dll!osg::Node::isCullingActive() Line 191 + 0x39 bytes
C++
osg33-osgd.dll!osg::CullStack::isCulled(const osg::Node & node={...})
Line 109 + 0x8 bytes C++
osg33-osgUtild.dll!osgUtil::CullVisitor::apply(osg::Group & node={...})
Line 969 + 0x12 bytes C++
osg33-osgd.dll!osg::Group::accept(osg::NodeVisitor & nv={...}) Line 38
+ 0x41 bytes C++
osg33-osgUtild.dll!osgUtil::SceneView::cullStage(const osg::Matrixd &
projection={...}, const osg::Matrixd & modelview={...}, osgUtil::CullVisitor *
cullVisitor=0x1ad331e8, osgUtil::StateGraph * rendergraph=0x1ad326c0,
osgUtil::RenderStage * renderStage=0x1ad327b0) Line 821 + 0x42 bytes C++
osg33-osgUtild.dll!osgUtil::SceneView::cull() Line 687 + 0x4e bytes
C++
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org