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 »

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.

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

Re: Scene doesn't render in orthographic projection

Post by dark_sylinc »

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.

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

Re: Scene doesn't render in orthographic projection

Post by manduco »

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

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

Re: Scene doesn't render in orthographic projection

Post by luis »

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.

Post Reply