- Home /
3dTexture does not scale to matrix dimensions
Hello, i am trying to display a 3d volume using volume rendering and 3d textures. however, my 3d volume has different size dimensions for x,y,z, ie, instead of 256x256x256, it has 100x200x150.
i am trying to alter the vertices of the mesh, which are as follows (this would work in the case of a 256x256x256 volume:
var vertices = new Vector3[] {
new Vector3 (-0.5f, -0.5f, -0.5f),
new Vector3 ( 0.5f, -0.5f, -0.5f),
new Vector3 ( 0.5f, 0.5f, -0.5f),
new Vector3 (-0.5f, 0.5f, -0.5f),
new Vector3 (-0.5f, 0.5f, 0.5f),
new Vector3 ( 0.5f, 0.5f, 0.5f),
new Vector3 ( 0.5f, -0.5f, 0.5f),
new Vector3 (-0.5f, -0.5f, 0.5f),
};
however, when i try to change the vertex positions to fit my volume dimensions (ie, i would change the x to go form -.25 to 0.25, instead of -0.5 to 0.5) it doesn't stretch the volume to the correct dimensions, instead, it just chops off that part of my volume, showing a smaller slab in the x dimension.
here's an example: the brain is far too long in the up-down direction, and too short in the back-front direction. i want to resize my mesh to accomodate these dimensions, but changing the vertex positions on the mesh doesn't seem to do anything (it just chops the volume).