Disapearing Mesh when moving camera

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
Memorial76
Posts: 103
Joined: Mon Aug 10, 2009 8:22 pm
Location: France

Disapearing Mesh when moving camera

Post by Memorial76 »

I have a strange trouble with my scene.

I create a sphere mesh scene node with a radius R.
When my camera's position X is greater than R or lesser than -R my sphere disapear. But it doesn't occur with Y or Z component of position.

As anybody any idea about that?
Thanks
CuteAlien
Admin
Posts: 9929
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

If you are using 1.7 please try updating to 1.7.1. I'm not sure if the bug also affected the usual clipping, but it sounds a lot like something which could have been caused by the bug in the 1.7 aabbox collision test.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Re: Disapearing Mesh when moving camera

Post by randomMesh »

If you are using Irrlicht 1.7, it could be wrong culling due to the broken aabbox3d intersection functions.

In that case, it would help to upgrade to 1.7.1.
"Whoops..."
Memorial76
Posts: 103
Joined: Mon Aug 10, 2009 8:22 pm
Location: France

Post by Memorial76 »

Thanks a lot trying that at once and reporting.
Memorial76
Posts: 103
Joined: Mon Aug 10, 2009 8:22 pm
Location: France

Post by Memorial76 »

It's even worth!!! now it happens in each direction: each time Camera X, Y or Z is greater than R the sphere disapear!
CuteAlien
Admin
Posts: 9929
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Can you post some example-code so we can reproduce the problem? Otherwise it's hard to help ...
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Memorial76
Posts: 103
Joined: Mon Aug 10, 2009 8:22 pm
Location: France

Post by Memorial76 »

Allright:

here is my camera:

Code: Select all

scene::ICameraSceneNode* pCamera = m_pSceneMgr->addCameraSceneNodeFPS(0,
		1000,
		1000,
		-1,
		0,
		0,
		false,
		100,
		true,
		true);

pCamera->setPosition(core::vector3df(695000, 695000, 695000));
	pCamera->setTarget(core::vector3df(0,0,0));
	pCamera->setFarValue(10000000000);
here is the incriinated scene node:
the mesh "sun.3ds" has a radius of 6.96.
The same happens with a sphereSceneNode

Code: Select all

pSceneMgr->addMeshSceneNode(pSceneMgr->getMesh("./res/sun.3ds"),
		0,
		1,
		core::vector3df(0,0,0),
		core::vector3df(0,0,0),
		core::vector3df(100000,100000,100000));
Thanks for your interest!
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Post by randomMesh »

I'd say: Try a smaller world scale.
"Whoops..."
Memorial76
Posts: 103
Joined: Mon Aug 10, 2009 8:22 pm
Location: France

Post by Memorial76 »

Of course I tried it prior to posting here ;)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yeah, this far value will almost always lead to trouble due to zbuffer corruptions.
Memorial76
Posts: 103
Joined: Mon Aug 10, 2009 8:22 pm
Location: France

Post by Memorial76 »

Allright, i re-tried with values under 100 and it worked properly.
Sorry for that
Thanks a lot anyway
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

far value under 100 is also very strange, though it does not have such problems. Common values are around 10000-50000.
Memorial76
Posts: 103
Joined: Mon Aug 10, 2009 8:22 pm
Location: France

Post by Memorial76 »

For now it's okay up to 1 000 000 of Farvalue
Post Reply