Hi all,
I am working with CAD models converted to *.RAW which has simplest format in terms of vertices. I am able to read the file and draw the triangles to form the 3D model but all the color or material I give is flat colored. Can any one suggest me how can make my CAD model look like a 3D object in real sense
Please excuse me I am new so I am not aware how to give the code separately I will make it brief
<code>
glEnable (GL_DEPTH_TEST);
glEnable (GL_LIGHTING);
glEnable (GL_LIGHT0);
glLightfv(GL_LIGHT0, GL_SPECULAR, whiteSpecularLight);
glLightfv(GL_LIGHT0, GL_AMBIENT, blackAmbientLight);
glLightfv(GL_LIGHT0, GL_DIFFUSE, whiteDiffuseLight);
glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,redDiffuseMaterial);
glMaterialfv(GL_FRONT_AND_BACK,GL_EMISSION,redDiffuseMaterial);
glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mShininess);
objectfile = fopen(“C:\Users\RoBa\Desktop\sp.raw”, “r”);
while(!feof(objectfile))
{glBegin(GL_TRIANGLES);
…
glEnd();// Finished Drawing The Triangles}
fclose(objectfile);
</code>
Thank you in Advance !
Rohit