Page 1 of 1

Scene doesn't render in orthographic projection

Posted: Thu Sep 05, 2019 2:52 pm
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.

Re: Scene doesn't render in orthographic projection

Posted: Thu Sep 05, 2019 3:39 pm
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.

Re: Scene doesn't render in orthographic projection

Posted: Thu Sep 05, 2019 5:24 pm
by manduco
I did use setOrtho too and when I see something it looks okay. Could it be a frustrum culling issue?

Re: Scene doesn't render in orthographic projection

Posted: Sun Sep 08, 2019 4:35 pm
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.