[bug] Camera zNear not working as expected?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
erictheturtle
Posts: 5
Joined: Fri Jun 20, 2008 5:27 pm

[bug] Camera zNear not working as expected?

Post by erictheturtle »

Maybe I don't actually understand how the zNear and zFar work with cameras.

I thought it worked like this.
Image

But that's not the result I'm getting. For an easy example, start with the 01.HelloWorld example, and change this line:

Code: Select all

	smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));
To these lines:

Code: Select all

    ICameraSceneNode *cam = smgr->addCameraSceneNode(0, vector3df(0,5,-40), vector3df(0,5,0));
    cam->setNearValue(40);
    
    /* If you want to use the handy grid node to check the axis
    ISceneNode *grid = new CGridSceneNode(smgr->getRootSceneNode(), smgr);
    grid->setPosition(vector3df(0, 0, 0));
    grid->setRotation(vector3df(90,0,0));
    */
This is the result I'm seeing. Shouldn't she be cut in half?
Image

But I found if I double the near value to 80, I get the results I thought I should with 40. Am I understanding this right? What's going on here?

FYI Mac OS X, Irrlicht 1.4.1, OpenGL device
Last edited by erictheturtle on Wed Sep 03, 2008 7:19 pm, edited 1 time in total.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

hmmm, seems to be a problem with the OGL driver... :shock:

with OGL:
Image

and with DX9:
Image
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Looks like a bug in both the OpenGL and Burning drivers. It works as expected with the software and Direct3D drivers. I'm guessing it is a problem with the projection matrices.

Travis
Post Reply