I want to show a 3d model in a user interface, the UI is using aspect2d and the 3d model is using render.
What i want is to show the 3d model always in the center of the screen and above the UI, regardless if the user moves the camera.
How can i do that?
(Basicaly, how to update the position of the model to be always in front of the camera and above the UI)
Well, you can achieve the 3-d model always being in the same place onscreen by parenting the model to the camera; no need for a look-at task. But that won’t solve another problem: the render2d graph is always drawn on top of the 3-d graph, by default.
There are two solutions to this. The simplest solution is just to parent your 3-d model to aspect2d, then you can sort it relative to the gui. For instance, you can parent it directly to your gui frame, and scale it appropriately for the screen (you’ll probably need to make it very tiny).
The other solution is to open a new DisplayRegion with a new camera, that has a higher sort value than aspect2d, so that everything this new camera sees will be drawn on top of the gui. Then you can put your 3-d model in the new scene graph for this new camera.
Thanks Tutunkommon, but the thing is i don’t want to rotate or move the camera when i show the 3d model, just leave it fixed (or free to move) and show the model in the center of the screen.
I used the model with aspect2d as you said David, almost everything is fine, the only problem i had is how the model looks on screen, i attached two images to show you.