Hi,

I'm using OSG for a project, but I have some issues. I'm trying to create an 
heightfield, with this code : 

Code:
 
osg::Image* heightMap = osgDB::readImageFile(fichier);
 
osg::HeightField* heightField = new osg::HeightField();
heightField->allocate(heightMap->s(), heightMap->t());
heightField->setOrigin(osg::Vec3(-heightMap->s() / 2, -heightMap->t() / 2, 0));
heightField->setXInterval(sizeUnity);
heightField->setYInterval(sizeUnity);
        
std::cout << heightField->getNumRows() << "," << heightField->getNumColumns() 
<< std::endl;




My image size is 100*100 (and so is heightMap), but the heightfield allocation 
fails, I have 100 rows and 0 columns.
I don't understand what's wrong. For this project I'm also using Qt, but I 
don't think there's compatibilty issues...
Is there something else to do to create the heightfield?

Thank you!

Cheers,
Isabelle

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=21878#21878





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

Reply via email to