3D Overlay Fun


23-05-2010 19:22:30


I have been trying to create the 3d Axis effect that you see in 3d modelers like Maya, 3ds max, Modo, etc. where a representation of the 3 axis is positioned in the lower right corner and rotates to match the camera's orientation. I have created an entity and attached it to a scenenode and that scenenode has been added to the overlay. I have two nodes my3dSN and my3dPitchNode to avoid the issue of inducing rotation.

self.my3dSN = self.SceneManager.createSceneNode()
self.my3dPitchNode = self.my3dSN.createChildSceneNode()

I create the effect of camera zoom by incrementing/decrementing the camera's FOV every time the mouse scroll wheel event is received(wxWidgets)

fovRadian = self.camera.getFOVy()
fovDegrees = fovRadian.valueDegrees()
fovDegrees += 2.0

My Problem:

When i zoom-out, the 3D overlay mesh gets smaller and when zooming-in the 3D overlay mesh gets larger. I understand this to be the perspective effect which causes objects to appear smaller the further away they are but I do not want this effect on my overlays. My 2d overlays do not do this and so I have been scouring the forum looking for any parameter that can be disabled or set/unset to stop the 3d overlay from doing this to no avail. I suspect that I might have to do some matrix magic with the projection matrix of the camera perhaps but I haven't been working with Ogre or Matrices that long so I can't say that I have become adept at manipulating either.

Basically, I want the the 3D overlays to be exempt from the perspective effect. The 3D overlays should behave like the 2D overlays and simply follow the camera and not change their appearance when the camera properties change. I would really appreciate it if anyone could shed some light on how to do this. I have been reading Matrix tutorials non-stop for the last few days. I've tried inverting the perspective matrix and/or multiplying the scale by the perspective matrix but at this point I'm guessing and trying things at random and nothing is working. :-(

Thanks in advance


01-06-2010 10:44:36

Suggest you post this on the main ogre forums as it's more a 'generic' Ogre question...