How do I set the Opengl view?

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

hey, please somebody help!
we works on a game and we need help

in gluPerspective the first argument is field of view(fov)
and you can get it this way for Blender projection:

factor = camera.lens/32
ratio = float(width)/float(height)
fovy = math.atan(0.5/ratio/factor)
fov = fovy*360/math.pi

see in this script all the OpenGL code for the projection:
http://xoomer.virgilio.it/glabro1/DOF.html
Ben

Ben:
Thanks your answer, but the fov calc doesn’t solve my problem.
the objects rotated, but still wrong and size’s not change.

I attach two pic

Blender:
http://moonlight.uw.hu/blender.jpg

My app:
without fov calc.
http://moonlight.uw.hu/my.jpg

Object size bad
Light rotated, and colour…

Thanks for the FOVY, mine was no working properly on sflender.

Emilio