-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for multiple bitmaps #3
Comments
Another prolem: |
Hey body. Support for multiple textures is not implemented. |
Ir order to support multiple textures there is 2 options:
a. Load multiple textures into opengl. Change this method so you can load multiple textures (as many as you like) instead of only 1:
... b. In the vertex shader declare an attribute of type int to store the index of the texture unit to use and pass it to the fragment shader:
c. In the fragment shader, declare an array of sample2D (you may have at most 8 textures active)
d. Load the different texture units into OpenGL as many times as texture units you want to load (maximum 8):
...
|
Dear @liyihongcug |
Thanks a lot for this software at first. Now I meet with one problem.I want to add different texture mapping bitmap in one cube. I search all codes many times. I choose Object3DBuilder .java.
Now it only support one bitmap. Can you help us realize add different texture mapping bitmap in one cube. (
bitmap[] bm.
bmp[0] = BitmapFactory.decodeResource(context.getResources(), R.drawable.aa);
bmp[1] = BitmapFactory.decodeResource(context.getResources(), R.drawable.bb);
bmp[2] = BitmapFactory.decodeResource(context.getResources(), R.drawable.cc);
bmp[3] = BitmapFactory.decodeResource(context.getResources(), R.drawable.dd);
bmp[4] = BitmapFactory.decodeResource(context.getResources(), R.drawable.ee);
bmp[5] = BitmapFactory.decodeResource(context.getResources(), R.drawable.ff)
not byte[] textureData and I want to change it to bimtap[]
)
file : Object3DBuilder.java
org.andresoviedo.app.model3D.model;public final class Object3DBuilder
public static Object3DData buildCubeV3(byte[] textureData) {
return new Object3DData(
createNativeByteBuffer(cubePositionData.length * 4).asFloatBuffer().put(cubePositionData),
createNativeByteBuffer(cubeTextureCoordinateData.length * 4).asFloatBuffer()
.put(cubeTextureCoordinateData).asReadOnlyBuffer(),
textureData).setDrawMode(GLES20.GL_TRIANGLES).setId("cubeV3").centerAndScale(1.0f);
}
The text was updated successfully, but these errors were encountered: