Hi Isabelle,

At first sight, there should be no problem with your code. Please double check 
that intermediate values are correct. Please also check that pointers are not 
NULL, etc... Qt should not be an issue, AFAIK.

Personal note: "Bon courage pour le projet !... Et pensez à utiliser un 
débuggeur comme je vous l'ai montré, vous gagnerez du temps. ;)"

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/

----- "Isabelle Gouwy" <[email protected]> a écrit :

> 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
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to