Set viewport for camera

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


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

Set viewport for camera

Post by xissburg »

How would you go about setting a viewport for rendering a camera? Ogre::Camera::setWindow doesn't seem to do anything. Think about rendering a scene from multiple points of view on the same render window, such as the typical 3dsmax look.

Thanks.

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 493
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 177

Re: Set viewport for camera

Post by sercero »

I think you want Render to Texture
https://wiki.ogre3d.org/Intermediate+Tutorial+7

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5476
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1358

Re: Set viewport for camera

Post by dark_sylinc »

xissburg wrote: Mon Nov 14, 2022 4:43 pm

How would you go about setting a viewport for rendering a camera? Ogre::Camera::setWindow doesn't seem to do anything. Think about rendering a scene from multiple points of view on the same render window, such as the typical 3dsmax look.

Thanks.

Hi, you no longer manipulate the viewport class directly.

See Samples/2.0/ApiUsage/StereoRendering sample on how to setup rendering for multiple/different regions of the RenderTarget (that sample uses two independent cameras, one for each region, but you can also use the same camera).

We have a section for it in the manual.

Cheers

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

Re: Set viewport for camera

Post by xissburg »

Thanks for the pointer. I wasn't considering using two workspaces. I'll give this a shot. I see I can also set the viewport offset dynamically so this will allow resizing as it will be required.

No, this is not related to render to texture.