[2.3] 3D Hub

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


marbey
Gnoblar
Posts: 9
Joined: Tue May 04, 2021 4:26 pm
x 1

[2.3] 3D Hub

Post by marbey »

Hello,

I would to create a 3D HUD with a 3D cube to rotate the scene, on top of my scene and always on the same place, in a corner.
I've try to create :

  • 1 Ogre::Window, who's shared between the scene and the HUD

  • 2 Ogre::SceneManager, one for the scene, one for the HUD

  • 2 Ogre::Camera, one for the scene, one for the HUD

  • 2 Ogre::CompositorWorkspace, one for the scene, one for the HUD, with setViewportModifier for the position of the HUD

but it doesn't work. Is there the good way to do this ?

An other question, is it possible to render only 1 Ogre::Window, whitout use Ogre::Root::renderOneFrame() ?

Thanks

xissburg
Halfling
Posts: 83
Joined: Sun Feb 21, 2010 4:58 pm
x 28

Re: [2.3] 3D Hub

Post by xissburg »

It sounds like you're on the right track, if I understood it correctly (made me think of the view cube in 3dsmax). You need a compositor with two passes, the second being explicitly configured to use another camera (possibly an orthographic camera if you don't want perspective for the cube) by including camera "HUD Camera" in the pass definition in the compositor script (then create a camera with this name before loading the workspace). It's important to set the render queues as well in each pass. For example, set rq_first 0 and rq_last 99 in the first pass and set rq_first 200 and rq_last 201 in the second pass. Then, when you create the Ogre::Item for the cube, make sure to initialize it with a render queue id equals 200. This will ensure that the cube will only be rendered in the second pass.