Author Topic: BitmapHelper rescale not working correctly?  (Read 1952 times)

Offline take2316

  • byte
  • *
  • Posts: 12
    • View Profile
BitmapHelper rescale not working correctly?
« on: March 09, 2013, 09:15:10 pm »
I'm creating a texture from a 640x480 image and want to rescale it to 256x256 for the texture. So I tried doing:
Code: [Select]
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:
Code: [Select]
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?

Offline take2316

  • byte
  • *
  • Posts: 12
    • View Profile
Re: BitmapHelper rescale not working correctly?
« Reply #1 on: March 09, 2013, 09:16:55 pm »
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!