BitmapHelper rescale not working correctly?

Started by take2316, March 09, 2013, 09:15:10 PM

Previous topic - Next topic

take2316

I'm creating a texture from a 640x480 image and want to rescale it to 256x256 for the texture. So I tried doing:
Texture texture = new Texture(BitmapHelper.rescale(b, 256, 256);
where b is the 640x480 Bitmap image. However, when I load it into a plane, only the middle of the image is shown in the texture:
Object3d plane = Primitives.getPlane(1, 100);

I verified this by saving the bitmap to my sdcard on the Android phone and indeed the saved bitmap shows the full picture. However, the texture looks like it's only the very middle portion of the bitmap. Is this how BitmapHelper.rescale works, i.e. saving the center portion first?

take2316

I think I just figured it out, a couple seconds after my post! I removed plane.calcTextureWrapSpherical() and it looks like the entire image is shown now in the texture!