[vtkusers] Texture Mapping--Helppppppppppp

Rachel aracha2010 at gmail.com
Thu Jan 6 08:51:14 EST 2011


since i have only points in my application i tried to use delaunay. So from
VTK example i removed the polygons and create delaunay, texture work
well.Then i used my own points and compute texture coordinates.
Unfortunately texture is not displayed. I think the texture coordinates are
not well computed. her is the code:

for (int z = 0; z < 1; z++)
		 {
		for (int y = 0; y < dims[1]; y++)
		  {
		  for (int x = 0; x < dims[0]; x++)
			{	
				unsigned char* pixel =static_cast<unsigned char*>
Image->GetScalarPointer(x,y,z));
				
						tuple[0] =0.0;tuple[1] = (float)y/dims[1]; tuple[2] =(float)x/dims[0];
						textureCoordinates->InsertNextTuple(tuple);

					
				
			}
		  }
		}

-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Texture-Mapping-tp3327802p3330414.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list