Hi,
I got an error. Anyone know what is it?
I am using visual studio. The program will stop at _callthreadstartex method
in threadex.c.
Error track:
'Test.exe': Loaded 'C:\OSG\bin\osgPlugins-3.0.0\osgdb_glsld.dll', Symbols
loaded.
First-chance exception at 0x77c47124 in Test.exe: 0x80000001: Not implemented.
Unhandled exception at 0x77c47124 in Test.exe: 0x80000001: Not implemented.
Here is my code: (If nx, ny, nz are used a small number such as 50, 50, 20,
the error is gone)
// read all data into unsigned char;
int nx = 350;
int ny = 350;
int nz = 60;
unsigned char pdisp_ptr = (unsigned char*)malloc(nx * ny * nz *
(sizeof(unsigned char)));
FILE *pf = fopen("data.txt", "r");
unsigned int dt;
int count = 0;
while (!feof(pf)) {
fscanf_s(pf, "%X", &dt);
*pdisp_ptr++ = dt;
count++;
if (count == nz) {
count = 0;
}
}
fclose(pf);
osg::ref_ptr<osg::Image> image = new osg::Image;
osg::ref_ptr<osgVolume::VolumeTile> tile = new osgVolume::VolumeTile;
tile->setVolumeTechnique(new osgVolume::RayTracedTechnique());
osg::ref_ptr<osgVolume::ImageLayer> layer= new
osgVolume::ImageLayer(image.get());
layer->rescaleToZeroToOneRange();
osg::ref_ptr<osgVolume::Volume> volume = new osgVolume::Volume;
volume->addChild(tile.get());
osgVolume::SwitchProperty* sp = new osgVolume::SwitchProperty;
sp->setActiveProperty(0);
osgVolume::AlphaFuncProperty* ap = new
osgVolume::AlphaFuncProperty(0.1f);
osgVolume::SampleDensityProperty* sd = new
osgVolume::SampleDensityProperty(0.005);
osgVolume::TransparencyProperty* tp = new
osgVolume::TransparencyProperty(1.0);
osgVolume::CompositeProperty* cp = new osgVolume::CompositeProperty;
cp->addProperty(ap);
cp->addProperty(sd);
cp->addProperty(tp);
sp->addProperty(cp);
layer->addProperty(sp);
tile->setLayer(layer.get());
image->setImage(nx, ny, nz, 4, GL_RGBA, GL_UNSIGNED_BYTE, pdisp_ptr,
osg::Image::NO_DELETE);
Regards,
Clement
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org