Log in or register to post comments

HELP!! MTL header file

November 20, 2013 - 6:24pm #1

HI, I had convert the mtl to a header file... As below:

// Created with mtl2opengl.pl

/*
source files: ./apple.obj, ./apple.mtl
materials: 3

Name: default
Ka: 0.300, 0.300, 0.300
Kd: 0.400, 0.400, 0.400
Ks: 0.700, 0.700, 0.700
Ns: 32.000

Name: material__14
Ka: 0.212, 0.063, 0.123
Kd: 0.000, 0.000, 0.000
Ks: 0.045, 0.045, 0.045
Ns: 6.000

Name: material__13
Ka: 0.094, 0.191, 0.333
Kd: 0.000, 0.000, 0.000
Ks: 0.045, 0.045, 0.045
Ns: 6.000

*/


int appleMTLNumMaterials = 3;

int appleMTLFirst [3] = {
0,
3,
1239,
};

int appleMTLCount [3] = {
3,
1236,
12120,
};

float appleMTLAmbient [3][3] = {
0.300,0.300,0.300,
0.212,0.063,0.123,
0.094,0.191,0.333,
};

float appleMTLDiffuse [3][3] = {
0.400,0.400,0.400,
0.000,0.000,0.000,
0.000,0.000,0.000,
};

float appleMTLSpecular [3][3] = {
0.700,0.700,0.700,
0.045,0.045,0.045,
0.045,0.045,0.045,
};

float appleMTLExponent [3] = {
32.000,
6.000,
6.000,
};

 

Do anyone know how to add into the java file?

Thanks

HELP!! MTL header file

November 21, 2013 - 6:05am #3

You will need to implement some code to read the MTL file and extract the relevant information;

then, you will need to adjust the shaders so to apply lighting effects to your mesh based on the MTL information;

the samples do not show how to achieve this; if you don't feel comfortable with OpenGL programming and shader programming, a better option would be to use Unity and the Unity Extension of Vuforia.

HELP!! MTL header file

November 21, 2013 - 3:55am #2

I am facing the same issue. 

 

do we have any way by which we can load .mtl ? 

Log in or register to post comments