Announcement

Collapse
No announcement yet.

SoVolumeData::usePalettedTexture

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SoVolumeData::usePalettedTexture

    Hello,

    I'm trying to use this function as False to put my self the 4 data R, G, B and A.
    But I don't reach to do it successfully.

    Maybe my way to use it is wrong ?

    here is an extract from my code :

    Code:
    const size_t blocksize = height * width;
        uint32_t * voxels = new uint32_t[blocksize];
    	uint32_t R,G,B,A;
    	for (int t = 0; t < blocksize; t++)
    	{
    		R = (uint32_t) image[4*t];
    		G = (uint32_t) image[4*t+1];
    		B = (uint32_t) image[4*t+2];
    		A = (uint32_t) image[4*t+3];
    		voxels[t] = R+(G>>8)+(B>>16)+(A>>24);
    	}
    
    
    	// Add SoVolumeData to scene graph
    	SoVolumeData * volumedata = new SoVolumeData();
    	volumedata->setVolumeData(dim, voxels, SoVolumeData::UNSIGNED_BYTE);
    	volumedata->setVolumeSize(SbBox3f(-256,-256,-3,256,256,3));
    	volumedata->SoVolumeData::usePalettedTexture = FALSE;
    	sep->addChild(volumedata);
    Before I was putting the values in an array of uint8_t 4 times bigger but it didn't work either.

    Thank you for helping me, and sorry for my English if I have made mistakes
Working...
X