Rendering a scene with multiple element

Started by
1 comment, last by Zakwayda 5 years, 3 months ago

Hi,

I have been practicing the OpenGL tutorials and doing some text rending.  Now its time to build a simple program with various UI components.

The components are basic but  separate.

I have;

  • A 3d  space area where I can rotate around my 3d model
  • I have a text status box at the bottom that informs me of progress / events of the simulation
  • I have filtering boxes at right hand side
  • I summary performance count on bottom right

I have a rough mock up attached.

 

The question I have is:  

Where can I find information / examples about putting the different elements together, so 3d area scales objects correctly, layout is "owned" by the correct space.

So the separate  components can be rendered in a single scene ?  For example 3d area which say is 80% of the screen area, is still a scaled replication of the 3d model.

 

 

All code is in C++/Open GL 3.5

 

 

 

 

 

Thanks

Ramman

 

Eg1.jpg

Advertisement

I don't know if this will answer your questions, but here are a few ideas.

You can use the viewport (glViewport()) to specify the area of the frame buffer you want to render to. You may need to specify a scissor area as well (glScissor(), GL_SCISSOR_TEST).

If you want the UI areas to be fully independent of the 3d area, rather than just superimposed on it (as seems to be the case based on your description), you could set the viewport/scissor to the upper-left area (in your mockup) for the 3d rendering, and then however you want (presumably to the full frame buffer) for the UI. Typically you'd use a perspective projection transform for the 3d rendering, and an orthographic projection transform for the UI rendering.

It's possible I missed a critical ingredient there somewhere, but it's all doable in principle, so if you run into problems they should be resolvable.

I'm not sure what you mean by the layout being owned by the correct space, but if you need more info (e.g. with respect to transforms, render order, depth testing, etc.), I'm sure someone will be able to help.

This topic is closed to new replies.

Advertisement