# Milkshape Materials

This topic is 4748 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Well, seeing as how there are no really good Milkshape classes out there that are also up to date, I decided to write my own. A half hour later, I had the makings of a semi decent class going (sure, it didn't have skeletal animation yet, and could only load, draw, and save models (not even the textures)) but it was decent for a half hours work. So anyway, I tested it, and it ran just fine... well, almost For some reason, whereas an image with nothing but material properties looked like this in milkshape (color scheme and model was strictly for test purposes) it came out looking like this in my class i checked over the output code
for(i=0; i<meshes; i++){
if(mesh.mati >= 0 && tempmi != mesh.mati){
tempmi = mesh.mati;

glMaterialfv(GL_FRONT, GL_AMBIENT, mat[tempmi].ambient);
glMaterialfv(GL_FRONT, GL_DIFFUSE, mat[tempmi].diffuse);
glMaterialfv(GL_FRONT, GL_SPECULAR, mat[tempmi].specular);
glMaterialfv(GL_FRONT, GL_EMISSION, mat[tempmi].emissive);
glMaterialfv(GL_FRONT, GL_SHININESS, mat[tempmi].shininess);
}

glBegin(GL_TRIANGLES);
for(l=0; l<mesh.numtris; l++){
glNormal3fv(mesh.normal[mesh.tri[l].ni1].as_array());
glVertex3fv(mesh.vert[mesh.tri[l].vi1].pos.as_array());

glNormal3fv(mesh.normal[mesh.tri[l].ni2].as_array());
glVertex3fv(mesh.vert[mesh.tri[l].vi2].pos.as_array());

glNormal3fv(mesh.normal[mesh.tri[l].ni3].as_array());
glVertex3fv(mesh.vert[mesh.tri[l].vi3].pos.as_array());
}
glEnd();
}


and the variable values for materials (RGBA values, not code) GL_AMBIENT = 0.000000 0.117647 0.941177 1.000000 GL_DIFFUSE = 0.270588 0.674510 0.000000 1.000000 GL_SPECULAR = 0.796079 0.011765 0.035294 1.000000 GL_EMISSION = 0.400000 0.274510 0.274510 1.000000 GL_SHININESS = 0.000000 and found everything to be correct (to my eyes anyway). So, the only conclusion I can draw from the above, is that Milkshape handles material properties in some way unknown to me. Which brings about my question, How should I handle material properties so that they show up the same in both Milkshape and my program? Thank you, relpats_eht (The Anti-Stapler) *edit* Thnanks, happybara [Edited by - relpats_eht on May 21, 2005 4:18:50 PM]

##### Share on other sites
use html
<img src="http://www.relpats-eht.com/images/milkshapever.jpg"><img src="http://www.relpats-eht.com/images/myver.jpg">

##### Share on other sites
hrm... apparently the yellow turning to white was caused by full light intensity, so the only problem left is why the colors of the yellow and purpleish arent blending to make the redish.

• 19
• 10
• 19
• 14
• 20