jPCT-AE - a 3d engine for Android > Bugs

BitmapHelper rescale not working correctly?


I'm creating a texture from a 640x480 image and want to rescale it to 256x256 for the texture. So I tried doing:

--- Code: ---Texture texture = new Texture(BitmapHelper.rescale(b, 256, 256);
--- End code ---
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: ---Object3d plane = Primitives.getPlane(1, 100);
--- End code ---

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?

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!


[0] Message Index

Go to full version