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

Adding / modifying textures on a plane primitive on the fly.

<< < (3/3)

davec64:
I have modified the technique slightly see the new modified vertex controller code.
depth is just an index to which texture you want to apply to the polygon.
Each texture is 32*32 if you want to use more just reduce the multiplier to 16 to give 16*16 textures  or make the main 256*256 texture larger.
 
# 256 is the texture size
# 32 is the size of each subtexture
/**
   * this is the fraction of the texture that represents 1 sub texture
   */
  public static float SUBTEXTURE = (float) ((1.0 / 256.0) * 32);

/**
   * this is the fraction of the texture that represents the inside of sub texture take away half a
   * pixel from the edge of the texture
   */
  public static float INTERNALSUBTEXTURE = (float) ((1.0 / 256.0) * 32 - (1 / 256));

Screek:
Thank you for explanation, everything works as expected :)

Navigation

[0] Message Index

[*] Previous page

Go to full version