Log in or register to post comments

Models with multiple texture maps

December 22, 2012 - 4:26am #1

I wish to include this model in my application:

http://www.turbosquid.com/3d-models/sofa-plutone-max-free/657824

It contains multiple texture maps and a single obj file. Can you give me some guidelines as to how to include those textures in my app? Thanks in advance.

Models with multiple texture maps

June 29, 2017 - 6:48am #7

I'm Facing Same Problem. Please let me know if any tutorial or example for this problem using Android Studio with Vuforia OpenGL ES 3.

 

Models with multiple texture maps

August 26, 2015 - 9:19pm #6
I am trying to apply multiple materials on the same object.
 
I adopted the suggested approach, created various objects to apply texture on each part separately.
 
When they display all the parties are in the center one on top of another, superimposed.
 
I am using the following code in java, java only. (ImageTarget sample)
 
private void renderFrame() {

...

renderCadeiraBase(textureIndex, modelViewProjection);
renderCadeiraEncosto(textureIndex, modelViewProjection);
renderCadeiraAssento(textureIndex, modelViewProjection);
SampleUtils.checkGLError("Render Frame");
}

Example of these methods:

private void renderCadeiraBase(int textureIndex, float[] modelViewProjection){
        //cadeira assento
        GLES20.glVertexAttribPointer(vertexHandle, 3, GLES20.GL_FLOAT, false, 0, cadeiraBase.getVertices());
        GLES20.glVertexAttribPointer(normalHandle, 3, GLES20.GL_FLOAT, false, 0, cadeiraBase.getNormals());
        GLES20.glVertexAttribPointer(textureCoordHandle, 2, GLES20.GL_FLOAT, false, 0, cadeiraBase.getTexCoords());

        GLES20.glEnableVertexAttribArray(vertexHandle);
        GLES20.glEnableVertexAttribArray(normalHandle);
        GLES20.glEnableVertexAttribArray(textureCoordHandle);

        // activate texture 0, bind it, and pass to shader
        GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
        GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTextures.get(textureIndex).mTextureID[0]);
        GLES20.glUniform1i(texSampler2DHandle, 0);

        // pass the model view matrix to the shader
        GLES20.glUniformMatrix4fv(mvpMatrixHandle, 1, false, modelViewProjection, 0);

        GLES20.glDrawArrays(GLES20.GL_TRIANGLES, 0, cadeiraBase.getNumObjectVertex());

        // disable the enabled arrays
        GLES20.glDisableVertexAttribArray(vertexHandle);
        GLES20.glDisableVertexAttribArray(normalHandle);
        GLES20.glDisableVertexAttribArray(textureCoordHandle);
    }
I do not know much about OpenGL.
 
Like the parts of the chair would fit not in the center but in the original positions it.
 
If you need more information please let me know.

 

Models with multiple texture maps

November 30, 2013 - 7:43am #5

You can do that by applying the Texture to a material and assigning the material to the model components programmatically - http://answers.unity3d.com/questions/13356/how-can-i-assign-materials-using-c-code.html

http://docs.unity3d.com/Documentation/ScriptReference/Material.html

Models with multiple texture maps

November 30, 2013 - 4:13am #4

Hi Al,

I am also confused with the multiple texture problem. Most of the client 3D models are having multiple textures. Is there any reference on how to assign multiple textures to a model in Unity?

Thanks,

BP

Hi natToc, first, I would

January 6, 2013 - 8:23am #3

Hi natToc,

first, I would recommend to read these two posts that explain the basics about replacing the teapot model with custom models and setting custom textures:

 

https://developer.vuforia.com/forum/faq/android-how-do-i-add-textures-my-model

https://developer.vuforia.com/forum/faq/android-how-do-i-replace-teapot

 

if you already have read those posts and you are familiar with those techniques, then, coming to your actual problem:

 in order to apply multiple textures to your model (i.e. a model that contains multiple sub-parts, with a different texture for each part), you would need to:

- export each part of the model to an OBJ file (thus ending up with a set of multiple OBJ files);

- convert each OBJ file to a C++ header for OpenGL (similar to the "Teapot.h" header of the ImageTargets sample) defining a vertex array for that part.

- add those header files to your project, and bind a different texture for each part (see the "renderFrame()" function in ImageTargets.cpp);

This process above is however quite involved (and it also depends on the ability of your 3D Modeling environment to select and export the different parts of your model separately).

Unfortunately there is no "simple recipe" to support such use case using OpenGL ES.

 

If that sounds too complicated or too costly to implement, the alternative is to consider using Unity 3D and the Vuforia extension for Unity; Unity 3D will be able to handle your 3D models even when they are relatively complex and consisting of various sub-parts with multiple textures.

I hope this helps. 

 

Models with multiple texture maps

January 4, 2013 - 8:36am #2

No response to behind question?. No body response about multiple textures in same 3D model in any part of this forums?

Log in or register to post comments