Scene doesn't render in orthographic projection

Problems building or running the engine, queries about how to use features etc.
Post Reply
manduco
Gnoblar
Posts: 2
Joined: Wed Sep 04, 2019 11:02 pm

Scene doesn't render in orthographic projection

Post by manduco » Thu Sep 05, 2019 2:52 pm

The scene renders fine with normal projection, but when I use setProjectionType(PT_ORTHOGRAPHIC) on camera I see nothing.
To be exact, almost nothing: there are a few camera angles where I can see the scene, oddly enough.
I know position is correct, and so are clip planes. Not sure what to do. Thanks.
0 x

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

Re: Scene doesn't render in orthographic projection

Post by dark_sylinc » Thu Sep 05, 2019 3:39 pm

Hi!

When you're in orthographic mode, aside from position & orientation which are relevant like in projection mode, the function setOrthoWindow becomes relevant, as it tells how "big" the ortho projection is.
0 x

manduco
Gnoblar
Posts: 2
Joined: Wed Sep 04, 2019 11:02 pm

Re: Scene doesn't render in orthographic projection

Post by manduco » Thu Sep 05, 2019 5:24 pm

I did use setOrtho too and when I see something it looks okay. Could it be a frustrum culling issue?
0 x

User avatar
luis
Greenskin
Posts: 119
Joined: Tue Mar 02, 2004 3:33 pm
Location: Spain / Argentina
x 4
Contact:

Re: Scene doesn't render in orthographic projection

Post by luis » Sun Sep 08, 2019 4:35 pm

I'm using ortho with this parameters:

Code: Select all

	mCamera->setProjectionType( PT_ORTHOGRAPHIC );
	mCamera->setPosition( 70.0, 50.0, 125.0 );
	mCamera->lookAt( 70.0, -40.0, 0.0 );
	mCamera->setOrthoWindowHeight( 528.0 );
The game displays a terrain in front the camera (the racing track) and the terrain is a square of about 140 units long
This code is quite old I'm setting position in the camera itself instead of attaching it to a node and settings position to the node.
Hope this helps.
0 x

Post Reply