I use Volumizer in combination with OpenInventor. I cutted my Volume
using a SoClipPlane (works great!). Now I try to grab the texture of the
cuttingPlane and map it on an OpenInventor Object.
I think the following should work (please correct me if i'm wrong!):
- create allVertexData
- create aPolygonSetArray
- xfmVox2TexCoords
- polygonizeMPR using the planeEquation of SoClipPlane
- grab the geometry data from the aPolygonSetArray
- grab the texture data from the aPolygonSetArray
- use SoCoordinate3 Object to store geometry
- use SoTextureCoordinate2 to store texture
- use SoNormal
- use SoNormalBinding
- use SoTextureCoordinateBinding
- use So(Indexed)FaceSet
problems:
- The polygonSetArray does not have any vertexData after create
aPolygonSetArray! Why?
I took parts of the code of voglMPR1.cxx which also does the first 3
steps and it works fine there!
- I use an interleavedArrayFormat V3F, which stores the vertexdata but
no texture. Where is the texture stored? I also tried to change the
Format to T3F_V3F which could store texture but it also did not work.
// Holds all intermediate PER_VERTEX information.
allVertexData = new voVertexData(100000, valuesPerVtx);
aPolygonSetArray = new voIndexedFaceSet**[maxBrickCount];
for (int n1 = 0; n1 < maxBrickCount; n1++) {
aPolygonSetArray[n1] = new voIndexedFaceSet*[samplesNumber];
for (int n2 = 0; n2 < samplesNumber; n2++)
// do not pre-allocate index buffers to save space
aPolygonSetArray[n1][n2] = new voIndexedFaceSet(allVertexData,
0);
}
--
\|/
@ @
======================================================oOO(_)OOo=====
Werner Wohlfahrter
Fraunhofer CRCG, Inc.
321 South Main St.
Providence, RI 02903, USA