Hi!
I’d like to show some objects in OpenGl. I’ve written an export script in python. (python is cool :))
I export: Camera (locations, lens, rotation), Lights(type, location, color), Meshs(vertices, texcoords, faces, normals).
I’ve made a small progam which can load those datas.
Problem is: I can’t see scene like in Blender.
I think so, camera is bad.
I try it this:
Camera export:
Camera = CameraToLight
Position x:0.174 y:-8.02 z:2.215
Rot x:90 y:0 z:0
Lens = 35.0
End
OpenGl code:
glViewport(0, 0, ScreenWidth, ScreenHeight);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(35.0, ScreenWidth / ScreenHeight, 0.1, 100.0);
glRotatef(90, 1, 0, 0);
glTranslatef(0.174, -8.02, -2.215); !!! Z = Z * -1 Blender vs Opengl Z axis
glMatrixMode(GL_MODELVIEW);
glLoadIdentity;
and drawing commands....
I see a scene, but scene is smaller and turn round 180 angles.
I try this yet, but it was bad (certainly without glRotatef, glTranslatef)
gluLookAt(0.174, -8.02, 2.215, 0,0,0, 0, 1, 0);
Question is: How do I set the Opengl view?
lens - Fov conversion, Blender’s locate and rotate values using in OpenGl.
regards,
Kammu