Dirk Reiners wrote:
        Hi Mario,

Mario Lüttich wrote:
my hardware are Athlon AM2 4600+ XP with a Nvidia 8800 GTX.
I think my hardware is not the problem, because the graphic card has 768 MB ram.

Nice! I want one of those! And no, that hardware is definitely not the problem.

 > Can it be that opensg dedect it  incorrect?

That's always possible. I've never run it on that card (BTW, which driver version are you running?), so there could be something unexpected.

To point two, the 3D texture is not scale down, it is cutting the rest of the image.

Hm, that is weird. I can't think of any obvious reasons for that behavior. Is the program that you use small enough to send it to me to take a look at it?

Yours

        Dirk

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users
Hi Dirk,

i have write a mini test program to demonstrate the problem. The importal stuff is:

// OpenSG
SimpleSceneManager  *_mgr;
NodePtr              _scene;
NodePtr                 _trans;
DVRVolumePtr         _vol;
DVRIsoSurfacePtr     _iso;
PassiveWindowPtr     _gwin;
DVRAppearancePtr     _app;
DVRVolumeTexturePtr  _tex;
DVRShaderPtr         _shader;

Test::Test(void* win)
{

   osgInit(0, NULL);

   _hDC = GetDC(_hWnd);
   if(!_hDC)
   {
       DestroyWindow(_hWnd);
       return;
   }

   PIXELFORMATDESCRIPTOR pfd = { sizeof(PIXELFORMATDESCRIPTOR) };

   pfd.nVersion    = 1;
   pfd.dwFlags        = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL;
   pfd.iPixelType    = PFD_TYPE_RGBA;
   pfd.cColorBits    = 32;
   pfd.iLayerType    = PFD_MAIN_PLANE;

   int nPixelFormat = ChoosePixelFormat(_hDC, &pfd);
   if(!nPixelFormat)
   {
       ReleaseDC     (_hWnd, _hDC);
       DestroyWindow (_hWnd);

       return;
   }

   BOOL bPixelFormat = SetPixelFormat(_hDC, nPixelFormat, &pfd);
   if(!bPixelFormat)
   {
       ReleaseDC(_hWnd, _hDC);
       DestroyWindow(_hWnd);

       return;
   }

   _hRC = wglCreateContext(_hDC);
   if(!_hRC) {
       ReleaseDC     (_hWnd, _hDC);
       DestroyWindow (_hWnd);
       return;
   }
   wglMakeCurrent (_hDC, _hRC);

   _gwin = PassiveWindow::create();
   _gwin->init();

   // create the SimpleSceneManager helper
   _mgr   = new SimpleSceneManager;
   _scene = Node::create();
   _trans = Node::create();

   // tell the manager what to manage
   _mgr->setWindow(_gwin );
   _mgr->setRoot  (_trans);

   load();

   _w = 0;
}

void Test::load()
{
   FILE* f = fopen ("D:\\data64_3d.img", "rb");

   UInt8* buffer = new UInt8 [128*128*128];

   fread (buffer, 128*128*128,1 , f);
   fclose (f);

   ImagePtr datImage = Image::create();
   datImage->set(Image::OSG_L_PF ,128,128,128);
   datImage->setAttachmentField( "SliceThickness", "1 1 1" );

   UInt8 *d = (UInt8*) datImage->getData();

   beginEditCP(datImage);
   for (int i= 0; i <  128*128*128; i++)
   {
       *d++ = buffer[i];
   }

   endEditCP(datImage);

   _vol         = DVRVolume::create();
   _app         = DVRAppearance::create();
   _tex         = DVRVolumeTexture::create();
_iso = DVRIsoSurface::create(); _shader = DVRIsoShader::create();
   TransformPtr trans = Transform::create ();
Quaternion q = Quaternion(Vec3f(0,1,0), 5 );
   Matrix m;
   m.setRotate (q);
beginEditCP(trans);
   trans->setMatrix(m);
   endEditCP(trans);

   beginEditCP(_trans);
   _trans->setCore (trans);
   beginEditCP(_trans);

   beginEditCP(_tex);
   _tex->setImage(datImage);
   beginEditCP(_tex);

   beginEditCP(_iso, DVRIsoSurface::IsoValueFieldMask);
   _iso->setIsoValue(0.5);
   endEditCP(_iso, DVRIsoSurface::IsoValueFieldMask);

   // Attach the volume texture to the appearance
   beginEditCP(_app, Node::AttachmentsFieldMask);
   _app->addAttachment(_tex);
   _app->addAttachment(_iso);
   endEditCP  (_app, Node::AttachmentsFieldMask);

   // Assign the appearance to the volume core
   beginEditCP(_vol);
   _vol->setAppearance(_app);
   _vol->setShader(_shader);
   //_vol->setBrickStaticMemoryMB(64);
   endEditCP(_vol);

   _trans->addChild (_scene);

   beginEditCP    (_scene);
   _scene->setCore (_vol);
   endEditCP      (_scene);
}

The program is compiled under windows xp for AMD64 with the latest driver version from nvidia.

Thanks again

Mario


begin:vcard
fn;quoted-printable:Mario L=C3=BCttich
n;quoted-printable:L=C3=BCttich;Mario
org:MPI for Biophysical Chemistry 
adr;quoted-printable;quoted-printable:;;Fa=C3=9Fberg 11;G=C3=B6ttingen;37077;;Germany
email;internet:[EMAIL PROTECTED]
title:Diplom Physiker
tel;work:+49 (0) 551 201 1454
tel;fax:+49 (0) 551 201 1197
version:2.1
end:vcard

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to