Can someone confirm whether they see the same problem that I am seeing with OpenB3D.

I place a light behind the camera.I load a model to animate.Everything is fine so far. In my case model is facing away from camera with light on its back as I would expect.When I set the animate command the model is now rotated 180 on the y axis and the light is still on its back which is now facing away from the camera. Any other non animating objects in scene are still lit correctly.

Here's some code to test. I am using Blitzmax but it should translate easily to other languages.

OK I have been investigating further and it does appear to be an issue with certain models that I use. I happen to pick two that went wrong when testing initially and assumed issue applied to all.

I tried with both MiniB3D and OpenB3D which showed same results but loading same model into Blitz3D shows no issues. It would appear that the model is initially facing the wrong way when loaded into MiniB3D, but when animating is facing the right way(although lighting is screwed up), assuming Blitz3D is correct.

The difference with Blitz3d is that DirectX uses a left handed coordinate system and OpenGL is right: left handed is x axis to left, y up, z away from view, whereas right handed is x to right, y up, z away.

To make code more portable from Blitz3d CameraProject is inverted (on z axis) which means rotation, turn and pitch commands need to be inverted (on x axis), the library inverts the z but not pitch so the wrapper does it.