Hi All,
I just started using OSG with Qt4.2.2 (for a client's
application) and need to display and use a 2D image in
3D.
The code that creates my geometry is something like
this:
                osg::Geometry* pictureQuad =
osg::createTexturedQuadGeometry(
                        pos, // corner should be origin
                        osg::Vec3(width,0.0f,0.0f), // xaxis
                        osg::Vec3(0.0f,height,0.0f), // yaxis
                        0.0f,0.0f, 1.0f,1.0f);

                osg::Texture2D* texture = new osg::Texture2D(image);
        
texture->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR);
        
texture->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR);
        
pictureQuad->getOrCreateStateSet()->setMode(GL_LIGHTING,
osg::StateAttribute::OFF);
        
pictureQuad->setColorBinding(osg::Geometry::BIND_OVERALL);
        
pictureQuad->getOrCreateStateSet()->setTextureAttributeAndModes(0,
                        texture,
                        osg::StateAttribute::ON)
                return pictureQuad;




I also tried the example code from texture2D in my
application. In both cases, the executable works on
some machines, but displays a white rectangle on most
of the machines. What am I doing wrong here? Do I need
to set up some environment variables at compile/run
time, or is it a graphics card related issue? If
anyone can see the cause of the problem or point me in
the right direction so that the program runs on all
machines, I'd appreciate it. 
I'm using OSG1.2, the september release version, and
just downloaded and compiled the SVN version, will
test it out later. To test it on other machines, I
copy all the dlls and the executable to those machines
(I do not compile on those machines). I've seen the
application work on my NVIDIA Go 7800, and an old
FX5600, and it fails on two high-end quadros, among
other cards.

On a different note, the matrix to quaternion unittest
for qt (in debug mode) fails for me. Here's the
output:


*****   Qualified Tests  ******
root.osg.Matrixd.testMatrixToQuat
root.osg.Vec3.testAddition
root.osg.Vec3.testSubtraction
root.osg.Vec3.testScalarMultiplication
root.osg.Vec3.testDotProduct

******   Running tests   ******
fail    root.osg.Matrixd.testMatrixToQuat      
0.00165664s     q1.length() == l
1_ failure: \Workspace\Osg svn
checkout\OpenSceneGraph\examples\osgunittests\Uni
tTests_osg.cpp, line 51
pass    root.osg.Vec3.testAddition      3.07302e-006s
pass    root.osg.Vec3.testSubtraction   2.51429e-006s
pass    root.osg.Vec3.testScalarMultiplication 
2.51429e-006s
pass    root.osg.Vec3.testDotProduct    1.95556e-006s


Thanks in advance,
Sohaib Athar.



 
____________________________________________________________________________________
No need to miss a message. Get email on-the-go 
with Yahoo! Mail for Mobile. Get started.
http://mobile.yahoo.com/mail 
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to