how to create floor plane that extends to infinity?

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
pverlaine999
Posts: 16
Joined: Wed May 04, 2011 12:30 pm

how to create floor plane that extends to infinity?

Post by pverlaine999 »

Hi,

I create a floor plane with something like this:

Code: Select all

	    SMaterial * material = new SMaterial();
	    material->AntiAliasing = EAAM_QUALITY | EAAM_LINE_SMOOTH | EAAM_POINT_SMOOTH;
	    material->Thickness = 1.0f;

	    IAnimatedMesh *movingPlane = smgr->addHillPlaneMesh("floor",
	    		core::dimension2df(10, 10),
	    		core::dimension2du(100, 100),
	    		material);
	    IAnimatedMeshSceneNode *myfloor = smgr->addAnimatedMeshSceneNode(movingPlane);
This has to set the size of the plane. But I'd like to have a floor plane that extends to infinity in all directions, so that when I move my camera, I'll never reach the end.

How could I do that?

Thanks for all.

Paul
ChaiRuiPeng
Posts: 363
Joined: Thu Dec 16, 2010 8:50 pm
Location: Somewhere in the clouds.. drinking pink lemonade and sunshine..

Post by ChaiRuiPeng »

there is no true infinity in computers, however you can simulate this.

it depends on what you want exactly.

judging by your code snippet it seems you want a "terrain", with height and all that extending in all directions? if so then you could just tile it dynamically on the fly.
ent1ty wrote: success is a matter of concentration and desire
Butler Lampson wrote: all problems in Computer Science can be solved by another level of indirection
at a cost measure in computer resources ;)
pverlaine999
Posts: 16
Joined: Wed May 04, 2011 12:30 pm

Post by pverlaine999 »

Sorry, newbie here. What does "tile it dynamically on the fly" means?

Thanks
ChaiRuiPeng
Posts: 363
Joined: Thu Dec 16, 2010 8:50 pm
Location: Somewhere in the clouds.. drinking pink lemonade and sunshine..

Post by ChaiRuiPeng »

oh sorry :P
well if i were to have to do something like this, i would just make a large mesh of whatever you want to tile, in your case that hillmesh scene node, and create x copies of it positioned all around the camera and maybe have a fog set so you don't have to create so many. as the player camera moves just tile more meshes in their correct positions and remove ones that get too far from the player camera.
ent1ty wrote: success is a matter of concentration and desire
Butler Lampson wrote: all problems in Computer Science can be solved by another level of indirection
at a cost measure in computer resources ;)
pverlaine999
Posts: 16
Joined: Wed May 04, 2011 12:30 pm

Post by pverlaine999 »

Thanks for explaining. So let me try to understand this.

Let's say I create 16 IAnimatedMeshSceneNode at the beginning, and stick them together by calling setPosition() for each of them, to form a 4x4 grid. Then as the camera move in one direction, I just stick more of it to the "front" of the camera, while removing some from the "back" of the camera.

Something like that, right?
roelor
Posts: 240
Joined: Wed Aug 13, 2008 8:06 am

Post by roelor »

exactly.
However, you'd probably be better off moving the plane on the back to the front.
(instead of removing it and creating a new one).
Post Reply